Synapse
  1. Synapse
  2. SYNAPSE-205

NPE in HttpCoreNIOSender and "I/O reactor has been shut down"

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: NIGHTLY
    • Fix Version/s: 1.1.1
    • Component/s: Transports
    • Labels:
      None

      Description

      When the target service is not available, a request to the proxy service causes the following exception:

      Exception in thread "HttpCoreNIOSender" java.lang.NullPointerException
      at org.apache.synapse.transport.nhttp.HttpCoreNIOSender$3.handleError(HttpCoreNIOSender.java:460)
      at org.apache.synapse.transport.nhttp.HttpCoreNIOSender$3.timeout(HttpCoreNIOSender.java:439)
      at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(SessionRequestImpl.java:151)
      at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(DefaultConnectingIOReactor.java:152)
      at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:96)
      at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:158)
      at org.apache.synapse.transport.nhttp.HttpCoreNIOSender.executeClientEngine(HttpCoreNIOSender.java:139)
      at org.apache.synapse.transport.nhttp.HttpCoreNIOSender.access$000(HttpCoreNIOSender.java:68)
      at org.apache.synapse.transport.nhttp.HttpCoreNIOSender$1.run(HttpCoreNIOSender.java:101)
      at java.lang.Thread.run(Thread.java:613)

      Any further request then fails with "java.lang.IllegalStateException: I/O reactor has been shut down".

      The instruction in HttpCoreNIOSender that causes the NPE is as follows:

      MessageContext nioFaultMessageContext =
      MessageContextBuilder.createFaultMessageContext(
      mc, new AxisFault(exception.toString(), exception));

      Probably, when handleError is called by the timeout (rather than the failed) method, as is the case here (see stacktrace), exception is null. The handleError method doesn't handle this situation appropriately.

      Note that this issue is similar but not identical to the one described in SYNAPSE-168.

      1. synapse-205.patch.txt
        2 kB
        Andreas Veithen
      2. synapse-205-with-cancel.patch.txt
        3 kB
        Andreas Veithen

        Issue Links

          Activity

          Michele Mazzucco made changes -
          Link This issue incorporates AXIS2-3532 [ AXIS2-3532 ]
          Michele Mazzucco made changes -
          Link This issue is part of AXIS2-3428 [ AXIS2-3428 ]
          Asankha C. Perera made changes -
          Assignee Asankha C. Perera [ asankha ]
          Fix Version/s 1.1.1 [ 12312917 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.2 [ 12312892 ]
          Andreas Veithen made changes -
          Attachment synapse-205-with-cancel.patch.txt [ 12373054 ]
          Andreas Veithen made changes -
          Attachment synapse-205.patch.txt [ 12372671 ]
          Asankha C. Perera made changes -
          Field Original Value New Value
          Fix Version/s 1.2 [ 12312892 ]
          Andreas Veithen created issue -

            People

            • Assignee:
              Asankha C. Perera
              Reporter:
              Andreas Veithen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development