Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-255

Timeouts when using the ProxyHandler and LoadBalancingProxyClient don't release the connection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 1.1.Beta2
    • 1.1.Beta1
    • Core

    Description

      When using the ProxyHandler with the LoadBalancingProxyClient, timeouts due to long processing on the eventual endpoint leave the Http connection open on the proxying server.

      Service layout:

      Service 1 - This is the service that uses the ProxyHandler with the LoadBalancingProxyClient.

      final ProxyHandler proxy = new ProxyHandler(new LoadBalancingProxyClient()
      .setConnectionsPerThread(1)
      .addHost(new URI("http", null, host, port, null, null, null), (String) null),
      timeout /* 3600 */, ResponseCodeHandler.HANDLE_404);

      Service 2 - This is the service that has that eventually handles the request. If this consumes more time then the proxy timeout then the Http connection to the caller of Service 1 is never released.

      Notes:

      When the proxy timeout is triggered it runs through the code at ProxyHandler->handleRequest() (line 133) where the comment "we rely on the close listener to end the exchange" states that the connection will be cleaned up by the close listener.

      The cleanup code in the ProxyConnectionPool->openConnection() (line 172) is called. This releases the connection back to the pool, but the exchange is never ended and thus the caller is left hanging.

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            vonnagy Ivan von Nagy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: