Uploaded image for project: 'HttpComponents HttpAsyncClient'
  1. HttpComponents HttpAsyncClient
  2. HTTPASYNC-74

IllegalStateException when sharing the connection manager amongst HttpAsyncClient instances

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.1
    • 4.1-beta1
    • None
    • JDK 1.7

    Description

      When several HttpAsyncClient instances share the same connection manager, IllegalStateException is thrown:

      15:23:10 ERROR - I/O reactor terminated abnormally
      java.lang.IllegalStateException: Illegal state ACTIVE
      at org.apache.http.util.Asserts.check(Asserts.java:40)
      at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:313)
      at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:189)
      at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.doExecute(CloseableHttpAsyncClientBase.java:67)
      at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.access$000(CloseableHttpAsyncClientBase.java:38)
      at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:57)
      at java.lang.Thread.run(Thread.java:744)
      GET http://www.apache.org/ HTTP/1.1->HTTP/1.1 200 OK
      Exception in thread "main" java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED
      at org.apache.http.util.Asserts.check(Asserts.java:40)
      at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:112)
      at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:72)
      at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:102)
      at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:87)
      at org.apache.http.examples.nio.client.SharedHttpAsyncClient2.makeRequest(SharedHttpAsyncClient2.java:51)
      at org.apache.http.examples.nio.client.SharedHttpAsyncClient2.main(SharedHttpAsyncClient2.java:40)

      Attachments

        1. SharedHttpAsyncClient.java
          3 kB
          Jose Dillet

        Activity

          People

            Unassigned Unassigned
            jdillet Jose Dillet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: