You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Philip Harvey (JIRA)" <ji...@apache.org> on 2013/09/05 17:45:57 UTC

[jira] [Updated] (QPID-5117) Java client deadlocks if connection is closed while onMessage() is creating a session

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

Philip Harvey updated QPID-5117:
--------------------------------

    Attachment: jcarder_result_2.dot

attached JCarder's output representing this potential deadlock.
                
> Java client deadlocks if connection is closed while onMessage() is creating a session
> -------------------------------------------------------------------------------------
>
>                 Key: QPID-5117
>                 URL: https://issues.apache.org/jira/browse/QPID-5117
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.22
>            Reporter: Philip Harvey
>         Attachments: jcarder_result_2.dot
>
>
> I have run the java systests with the [JCarder|http://jcarder.org/] agent attached. JCarder detected a potential deadlock when the following are done concurrently:
> * Application thread closes a connection
> * A MessageListener creates a new session on that connection inside onMessage().
> Here is a sketch of the wrongly-ordered locking:
> {noformat}
> Thread "main"
> 	AMQConnection.close()
> 		AMQConnection.doClose()
> 			lock AMQConnection._sessionCreationLock
> 			lock AMQSession.getMessageDeliveryLock()
> Thread "Dispatcher-1-Conn-780"
> 	AMQSession$Dispatcher.dispatchMessage()
> 		lock AMQSession.this._messageDeliveryLock
> 		myMessageListener.onMessage()
> 			AMQConnection.createSession()
> 				lock AMQConnection._sessionCreationLock
> {noformat}
> I've attached JCarder's GraphViz-format .dot file which represents this slightly more comprehensively.

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