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

IOReactorShutdownException: I/O reactor has been shut down, using apache httpclient5

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 5.0
    • None
    • HttpClient (async)
    • None

    Description

      we recently upgraded our httpclient version from 4.x to 5.0.3. 

      The main reason for the upgrade is to get rid of the 

      java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED

       exception that accures on version 4.x.

      After the upgrade, for some unknown reason we are experiencing this error now: 

      22:35:04,160 (pool-9-thread-1] ERROR http.async.HttpAsyncSender - Unable to send request, cause-I/O reactor has been shut down
      
      org.apache.ha.cores.reactor. IOReactorShutdownException: I/O reactor has been shut down at org.apache.ho.cores.reactor.AbstractIOReactorBase.connect(AbstractIOReactorBase.java:50)-thespoores-5.0.2.341/15.0.21
      
      at org.apache.ha.clients.http.impl.nio.Maltihome105essionRequesterfi.executellext (Multihome10Sessionequester.java:105) -[httpolients-5.0.3.3art/25.0.31 37021 at org.apache.he.clients.http.impl.nic.MultihomeI0SessionRequester$1.run (Multihome105essionRequester.java:153) -(httpclients-5.0.3.jar/15.0.3)
      
      at org.apache.hc.clients.http.impl.nio.Multihome10SessionRequester.connect (Multihome 10dessionequester-java:157)-[httpclient5-5.0.3.Jaz1/15.0.31 at org.apache.he.clients.http.impl.nio.DefaultAsyncClientConnectionOperator.connect (DefaultAsyncClientConnectionOperator.java:30) -[httpclients-5.0.3.jar!/15.0.3)
      
      at org.apache.ho.clients.http.impl.nio.PoolingAsyncClientConnectionManager.connect (FoolingAsyncClientConnectionManager.java:369) -[httpclients-5.0.3.jar!/15.0.3)
      
      at org.apache.he.clients.http.impl.wayng.InternalfetpAsyncExecRuntime.connectEndpoint (InternalttpAsynckxeckuntime.JAVA:210)-[httpclients-5.0.3-3art/15.0.31 at org.apache.ho.clients.http.impl.async.AsyncConnectExec.proceedTolfextop (AsyncConnectExec.java:195) -httpeltent5-5.0.3.jar/5.0.31
      
      at org.apache.ba.clients.http.impl.async.AsyncConnectExec.access2000 (AsyncConnectExec.java:79)-[httpclients-5.0.3.jar/15.0.3) at org.apache.ho.clients.http.impl-axyng.AsyncConnectExec.completed (AsyncConnectExec.java:146) -Thespelients-5.0.3.jar!/15.0.3)
      
      at org.apache.bo.clients.http-impl-async.AsyncConnectExecli.completed (AsyncConnectExec.java:135) -(httpelients-5.0.3.jar!/15.0.3)
      
      at org.apache.hc.clients.http.impl.axyng.InternalttpAsyncExecRuntimesi.completed (InternalNetpayncExecRuntime.java:114) -[httpclients-3.0.3.3art/15.0.3) at org.apache.bo.clients.http.impl.async.InternalfetpAryncExecRuntime1.completed [InternalttpAsyncExecRuntime.java:105) -(httpaliest5-5.0.3.jar!/15.0.31
      
      at org.apache.bc.cores.concurrent.Basicfuture.completed (Basicfuture.java:123) (httpoores-5.0.2.jar!/15.0.21 at org.apache.hc.cores.concurrent.ComplexFuture.completed (Complexfuture.179) (httpceres-5.0.2.jart/:5.0.21
      
      at peg.apache.he.clients.http.impl.nio.PoolingAsyncClientConnectionManager$1. leaseCompleted (PoolingAsyncClientConnectionManager.java:240) -[httpclients-5.0.3.3art/15.0.31
      
      at org.apache.ho.clients.http.impl.nio.PoolingAsyncClientConnectionManager$1.completed/FoolingAayneClientConnectionManager.JATA1275)-[httpclients-3.0.3.3az1/15.0.31 at org.apache.ho.clients.http.impl.nio.PoolingAsyncClientConnectionManager$1.completed(PoolingAsyncClientConnectionManager.java:224) -[httpclients-8.0.3.jar!/15.0.31
      
      at org.apache.bs.cores.concurrent.Basicfuture.completed(BasicFuture.java:123) -[httpeores-5.0.2.3art/15.0.23
      
      at org.apache.hc.cores.pool.strictConnPool.fireCallbacks (StrictConnPool.java:383) -(httpcore5-5.0.2.jar!/15.0.23 at org.apache.hc-cores.pool.strictcoonPool.Inase (Strict ConnPool.java:199)-[httpcores-5.0.2.jar!/15.0.21
      
      TRAR at org.apache.bo.clients.http.impl.nio.PoolingAsyncClientConnectionManager.lease (Foolinghayn ClientConnectionManager.java:225) (httpclients-5.0.3.3421/15.0.3) at org.apache.ho.clients.http.impl.anng.InternallttpyncExecRuntime.squireEndpoint (Internal:twyncExecuntime.java:100)-[httpclients-3.0.1.jart/25.0.31 at org.apache.he.clients.http.impl.async-AsyncConnectExec.execute(AsyncConnectExec.java:134)-[httpclients-5.0.2.jar/15.0.
      
      

      We have no idea why this error accures or what is causing it.

      The only major diffference between our version was that in the previus version with httpclient 4.x, we consumed the response:

      httpclient 4.x code:

      @override
      public void completed(HttpResponse response) {
          // some code ...
          EntityUtils.consume(response.getEntity());
      }

      but now we use `SimpleHttpResponse` instead of `HttpResponse` and `getEntity()` is not a function of `SimpleHttpResponse`, so we removed this code.

      So my question is, why the error above hppends? can it be related to the fact that we do not consume the response? and if so - why is it related? when do you need to use `consume()`?

      Attachments

        Activity

          People

            Unassigned Unassigned
            AssafZvigoren Assaf Zvigoren
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: