Author: ritchiem
Date: Tue Oct 9 06:11:41 2007
New Revision: 583147
URL: http://svn.apache.org/viewvc?rev=583147&view=rev
Log:
Qpid-626 : Patch provided by Aidan Skinner to address AMQSession Deadlocks.
Modified:
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
Modified:
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=583147&r1=583146&r2=583147&view=diff
==============================================================================
---
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
(original)
+++
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
Tue Oct 9 06:11:41 2007
@@ -519,11 +519,11 @@
+ Arrays.asList(stackTrace).subList(3,
stackTrace.length - 1));
}
- synchronized (_messageDeliveryLock)
+ synchronized (_connection.getFailoverMutex())
{
// We must close down all producers and consumers in an orderly
fashion. This is the only method
// that can be called from a different thread of control from the
one controlling the session.
- synchronized (_connection.getFailoverMutex())
+ synchronized (_messageDeliveryLock)
{
// Ensure we only try and close an open session.
if (!_closed.getAndSet(true))
@@ -577,9 +577,9 @@
*/
public void closed(Throwable e) throws JMSException
{
- synchronized (_messageDeliveryLock)
+ synchronized (_connection.getFailoverMutex())
{
- synchronized (_connection.getFailoverMutex())
+ synchronized (_messageDeliveryLock)
{
// An AMQException has an error code and message already and
will be passed in when closure occurs as a
// result of a channel close request