Qpid
  1. Qpid
  2. QPID-3234

Exception handling logic is incorrect in AMQConnection.java

    Details

      Description

      IMO there are two issues here.
      1. The exception listener gets notified of session level exceptions.
      2. A session level exception causes the connection to be closed along with the other sessions.

      1. We shouldn't notify the connection's exception listener when there is a session level error. The JMS API doc clearly states,
      "If a JMS provider detects a serious problem with a Connection object, it informs the Connection object's ExceptionListener, if one has been registered. It does this by calling the listener's onException method, passing it a JMSException argument describing the problem. "

      So certainly execution exceptions which only invalidates the session should not be notified via the exception listener.

      2. Going further if one looks at the AMQConnection.java exceptionReceived() method,
      It seems that an execution exception can in fact close the underlying connection (and the rest of the sessions) due to the following piece of logic.

      if (hardError(cause))
      {
      closer = (!_closed.getAndSet(true)) || closer;

      { _logger.info("Closing AMQConnection due to :" + cause); }

      }

      Digging further for any AMQException hardError method will return true.
      Therefore we need to rework that piece of code.

        Activity

        Rajith Attapattu made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Rajith Attapattu made changes -
        Resolution Later [ 7 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Assignee Rajith Attapattu [ rajith ]
        Rajith Attapattu made changes -
        Fix Version/s 0.18 [ 12322451 ]
        Robbie Gemmell made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Later [ 7 ]
        Rob Godfrey made changes -
        Labels exception-handling
        Robbie Gemmell made changes -
        Component/s Java Client [ 12311389 ]
        Alex Rudyy made changes -
        Attachment 0001-Fixing-soft-errors.patch [ 12503076 ]
        Danushka Menikkumbura made changes -
        Resolution Not A Problem [ 8 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Rajith Attapattu made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Not A Problem [ 8 ]
        Rajith Attapattu made changes -
        Field Original Value New Value
        Summary Exception handling logic is incorrect AMQConnection.java Exception handling logic is incorrect in AMQConnection.java
        Rajith Attapattu created issue -

          People

          • Assignee:
            Rajith Attapattu
            Reporter:
            Rajith Attapattu
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development