qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Praveen M <lefthandma...@gmail.com>
Subject Consumer.close() and session.rollback() deadlocks in the JMS client.
Date Thu, 22 Mar 2012 22:59:52 GMT
Hi,

   I am using the 0.16 codeline and am working with the Java Broker and JMS
client.

    I the following scenario,

1) Create transacted session
2) create Queue A.
3) Create a consumer and register a callback handler to the queue A using
the transacted session.
2) Enqueue a message to the queue A.
3) Close the consumer in the inititalization thread.
4) On the onMessage() callback of the handler try to rollback the session.

The consumer.close() call from the initialization thread and the rollback()
call from the handler thread arrive at a deadlock.

I've attached a test, which simulates the scenario explained above.

I tried to investigate this further a little bit, and found the actual 2
threads that get into the deadlock.

The deadlock is on the failovermutex() lock,

The consumer thread grabs the failovermutex() lock first and waits on the
session dispatcher lock,

whereas the handler thread, holds the dispatcher lock, and then tries to
grab the failovermutex() lock.

I've attached the actual stack traces of the deadlock, along with locks
grabbed list.

I'm curious is this is a issue with using the java broker only, as I see
that,

the sync() on the rollback call actually tries to set an exception(Please
see stack trace file attached).

It will be great if someone could let me know what is going on, and help
fix this.

I've logged a JIRA for this here

https://issues.apache.org/jira/browse/QPID-3911

Thanks a lot,
-- 
-Praveen

Mime
View raw message