Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-8466

Socket leak when setting HTTP Content-Length and client not reading entire response

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 10.1.0.Final
    • Web (Undertow)
      • Send multiple requests to the server.
      • Abort the requests after a few milliseconds.
      • On the server set the HTTP header field Content-Length.
      • Respond with random data (e.g. 10 MB as in the example app)

    Description

      Wildfly leaks half-open sockets if the client closes the connection before all data was sent to the client. This only happens when the HTTP header field "Content-Length" was manually set.

      The leaked sockets can be determined by "lsof -p <process-id> | grep identify". The relevant sockets are listed with "Can't identify protocol".

      The leak occurs if the client connection is closed (on the client side) before the server could send the complete response.

      It does not happen every time. I have attached an example application using a web browser as client. One button click sends the request 500 times. The socket does not leak on every button click.

      Another interesting fact is, that the socket will also leak if a Content-Length larger than the actual response data is set. This is independent from the client's behavior.

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              ritter_jira Johannes Ritter (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: