You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Alex Rudyy (Updated) (JIRA)" <ji...@apache.org> on 2011/11/09 14:25:51 UTC

[jira] [Updated] (QPID-3234) Exception handling logic is incorrect in AMQConnection.java

     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Rudyy updated QPID-3234:
-----------------------------

    Attachment: 0001-Fixing-soft-errors.patch

Attached a patch with a possible solution of an issue.

All execution exceptions are considered as soft exception in the patch. As result of it only affected session is closed and JMS connection remains opened (with the rest of the sessions) and can be reused for other operations.

Test SelectorTest#testRuntimeSelectorError needs to be amended because it expects that connection should be closed when server fails to evaluate a selector expression.
                
> Exception handling logic is incorrect in AMQConnection.java
> -----------------------------------------------------------
>
>                 Key: QPID-3234
>                 URL: https://issues.apache.org/jira/browse/QPID-3234
>             Project: Qpid
>          Issue Type: Bug
>            Reporter: Rajith Attapattu
>         Attachments: 0001-Fixing-soft-errors.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org