Hi All,

When I run the latest version of trunk I get a hang on
org.apache.qpid.test.unit.client.forwardall.CombinedTest
kill -3 (thread dump) provides information to say there is a deadlock.

I also noted that all AMQSession.createXXXMessage contains synchronization
code.
(in this case the deadlock happens inn AMQSession.createTextMessage trying
to obtain the failover mutex)

Do we really need this synchronization code when creating messages? I am not
really convinced it is needed.
Can someody explain the reason for that code block?

Regard,

Rajith

I have attached the trace below.

Found one Java-level deadlock:
=============================
"Dispatcher-Channel-1":
  waiting to lock monitor 0x09ff950c (object 0x8b85a1a0, a java.lang.Object
),
  which is held by "main"
"main":
  waiting to lock monitor 0x09ff964c (object 0x88ff0240, a java.lang.Object
),
  which is held by "Dispatcher-Channel-1"

Java stack information for the threads listed above:
===================================================
"Dispatcher-Channel-1":
        at org.apache.qpid.client.AMQSession.createTextMessage(
AMQSession.java:1057)
        - waiting to lock <0x8b85a1a0> (a java.lang.Object)
        at org.apache.qpid.client.AMQSession.createTextMessage(
AMQSession.java:1068)
        at org.apache.qpid.test.unit.client.forwardall.Service.onMessage(
Service.java:59)
        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(
BasicMessageConsumer.java:628)
        at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(
BasicMessageConsumer.java:583)
        at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(
AMQSession.java:2579)
        at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java
:2502)
        - locked <0x88ff0240> (a java.lang.Object)
        - locked <0x88ff0238> (a java.lang.Object)
"main":
        at org.apache.qpid.client.AMQSession.close(AMQSession.java:462)
        - waiting to lock <0x88ff0240> (a java.lang.Object)
        at org.apache.qpid.client.AMQConnection.closeAllSessions(
AMQConnection.java:752)
        at org.apache.qpid.client.AMQConnection.close(AMQConnection.java
:673)
        - locked <0x8b85a1a0> (a java.lang.Object)
        at org.apache.qpid.client.AMQConnection.close(AMQConnection.java
:659)
        at org.apache.qpid.test.unit.client.forwardall.Service.close(
Service.java:71)
        at
org.apache.qpid.test.unit.client.forwardall.ServiceCreator.closeSC(
ServiceCreator.java:57)
        at
org.apache.qpid.test.unit.client.forwardall.ServiceCreator.closeAll(
ServiceCreator.java:66)
        at org.apache.qpid.test.unit.client.forwardall.CombinedTest.tearDown
(CombinedTest.java:44)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)

Reply via email to