You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rajith Attapattu (JIRA)" <ji...@apache.org> on 2011/04/28 17:37:03 UTC

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

Exception handling logic is incorrect AMQConnection.java
--------------------------------------------------------

                 Key: QPID-3234
                 URL: https://issues.apache.org/jira/browse/QPID-3234
             Project: Qpid
          Issue Type: Bug
            Reporter: Rajith Attapattu


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.
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


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

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu closed QPID-3234.
----------------------------------

    Resolution: Fixed

The fix we made for QPID-3575 (svn rev 1362161) has effectively taken care of the work scoped by this JIRA. 

We now close the session in question instead of closing the connection (and all it's sessions).

We also still report the exception via the exception listener. This allows the application to make a decision on top of what we've already done.

This is also required when an application is using a message listener and have no way of receiving a session level exception.
                
> 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
>          Components: Java Client
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>              Labels: exception-handling
>             Fix For: 0.18
>
>         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
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


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

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu updated QPID-3234:
-----------------------------------

    Summary: Exception handling logic is incorrect in AMQConnection.java  (was: Exception handling logic is incorrect AMQConnection.java)

> 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
>
> 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.
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


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

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu closed QPID-3234.
----------------------------------

    Resolution: Not A Problem

After speaking with Robert Godfrey I agree that in some cases the Exception Listener is the only mechanism for a JMS client to know an issue with a session.
For example if there is a connection with a single session where a Consumer is using a Message Listener, then the only way the consumer would know if the session was closed if it is notified via the Exception Listener. In this case the session closure is infact a serious problem with the connection.

> 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
>
> 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.
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


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

Posted by "Alex Rudyy (Updated) (JIRA)" <ji...@apache.org>.
     [ 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


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

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036371#comment-13036371 ] 

Rajith Attapattu commented on QPID-3234:
----------------------------------------

The AMQP spec defines Connection errors as hard errors and Execution (Session) exceptions as soft errors.
So there is no question about how to determine if it's a hard error or not.

Unfortunately JMS does not have a session level exception listener to notify errors if the client is in a passive mode.
Ex. When using a message listener.
Therefore as explained above in some cases a session error is infact a serious issue that has to be notified and the only way to do so is the connection exception listener.

On the other hand, I do hear your point about the rest of the sessions being closed due to an error in just one session. It's not ideal, but given the limitation in JMS seems like a necessary evil.

It's probably better to for all the sessions to get canned and recreated than just one session silently failing and the application not knowing about it. From that perspective, I think the current behaviour makes sense.

> 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
>
> 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.
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


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

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu updated QPID-3234:
-----------------------------------

    Fix Version/s: 0.18
    
> 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
>          Components: Java Client
>            Reporter: Rajith Attapattu
>              Labels: exception-handling
>             Fix For: 0.18
>
>         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
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


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

Posted by "Robbie Gemmell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robbie Gemmell closed QPID-3234.
--------------------------------

    Resolution: Later
    
> 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
>          Components: Java Client
>            Reporter: Rajith Attapattu
>              Labels: exception-handling
>         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
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


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

Posted by "Robbie Gemmell (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robbie Gemmell updated QPID-3234:
---------------------------------

    Component/s: Java Client
    
> 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
>          Components: Java Client
>            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


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

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajith Attapattu reopened QPID-3234:
------------------------------------

      Assignee: Rajith Attapattu

I feel this issue has been fixed (as much as it can be) with the fix we made for QPID-3575. It appears you cannot update the resolution field unless you reopen the issue and resolve/close it again.
                
> 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
>          Components: Java Client
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>              Labels: exception-handling
>             Fix For: 0.18
>
>         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
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


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

Posted by "Danushka Menikkumbura (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Danushka Menikkumbura reopened QPID-3234:
-----------------------------------------


> 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
>
> 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.
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


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

Posted by "Danushka Menikkumbura (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036362#comment-13036362 ] 

Danushka Menikkumbura commented on QPID-3234:
---------------------------------------------

Rajith,

I think the issue here is how we decide if an error is "hard". Can we have a set of severity levels that helps figure out how hard the error is?

Thanks,
Danushka

> 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
>
> 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.
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