Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2152

I/O reactor shutdown when endpoint is closed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0.3, 5.1-beta1
    • 5.0.4, 5.1
    • HttpClient (async)
    • None

    Description

      I am using async http client for real time bidding project in a cluster of servers. Each server execute around 6K request per second and sometimes each server restarted becase I/O reactor is shutdown. It seems that there is a race condition in the code that produces this behavior.

      It seems that the race condition appears between this method:

      org.apache.hc.client5.http.impl.async.AsyncConnectExec$1.completed()

      and this method:

      org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager$InternalConnectionEndpoint.setSocketTimeout()

      because in the first method the endpoint is connected but in the second one this code fails:

       

      ManagedHttpClientConnection getValidatedConnection() {    
         final ManagedHttpClientConnection conn = getConnection();    
         Asserts.check(conn.isOpen(), "Endpoint is not connected");    
         return conn; 
      }

       

       

      Attachments

        1. httpclient_error_traces.txt
          18 kB
          Abraham Cabanillas

        Activity

          People

            Unassigned Unassigned
            Acabanillas Abraham Cabanillas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h 50m
                3h 50m