You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org> on 2011/06/02 04:54:47 UTC

[jira] [Commented] (QPID-3289) Session exceptions should only be notified via the exception listener, if it cannot be thrown directly to the application.

    [ https://issues.apache.org/jira/browse/QPID-3289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042580#comment-13042580 ] 

jiraposter@reviews.apache.org commented on QPID-3289:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/833/
-----------------------------------------------------------

Review request for qpid.


Summary
-------

As mentioned in the JIRA a simple solution is to not notify via the exception listener if a JMS exception can be directly thrown to the application.
The attached patch (unpolished) makes use of the sync call to determine if an application can be notified directly or not. 
If it is then it will not notify via the connection listener.
Andrew Kennedy had done some work previously to introduce a sync method in AMQSession_0_10.java to facilitate sync calls. 
This patch builds on top of it to provide the above functionality.

This patch also fixes issues like QPID-3259 and avoids other potential locking issues due to the two ways(paths) of notifying the same error.
Please note this patch only affects the 0-10 code path.


This addresses bug QPID-3289.
    https://issues.apache.org/jira/browse/QPID-3289


Diffs
-----

  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java 1129752 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java 1129752 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java 1129752 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java 1129752 
  http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java 1129752 

Diff: https://reviews.apache.org/r/833/diff


Testing
-------


Thanks,

rajith



> Session exceptions should only be notified via the exception listener, if it cannot be thrown directly to the application.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-3289
>                 URL: https://issues.apache.org/jira/browse/QPID-3289
>             Project: Qpid
>          Issue Type: Bug
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>
> The 0-10 code path in the JMS client always notifies a session exception via the connection listener, even when it can throw a JMS exception for a synchronous method call.
> For example session.createConsumer(destination) could fail due to an ACL violation and the session gets closed with an execution exception.
> Currently the JMS client throws an exception and also notifies the connection listener which results in the connection (and any other sessions associated with that connection) being closed.
> Another undesirable effect of this is the potential for deadlocks happening around the failovermutex.
> A reasonable solution for this problem would be to not notify via the connection listener if there is a way of throwing an exception to the application directly.
> For example session.createConsumer/Producer is a synchronous call and we could easily throw a JMS exception. In this case there is little value in notifying this via the connection listener and it also has the undesirable effect of closing the connection.

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