Red Hat Bugzilla – Bug 860851
Deadlock while attempting to reconnect to the broker
Last modified: 2012-09-26 17:32:57 EDT
Description of problem:
If reconnections are enabled within the Qpid C++ messaging API, it is possible to encounter a deadlock scenario when multiple threads attempt to recover the same disconnected connection.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. On the same connection create N sessions each with 1 receiver
2. Each receiver should execute nextReceiver on their session
3. Each receiver should reject any received messages
4. Send messages to the receivers and kill the broker connection
Thread A will own the lock to ConnectionImpl and will start the reconnection process -- when the connection succeeds, it will block attempting to lock each Session's lock. Thread B (if within the reject or other session-level action) will own the lock to the Session and will be blocked waiting on the lock to the ConnectionImpl.
Thread A and B reconnect to the broker without deadlock
After further analysis, issue appears to be different than the original write-up. I will open a new BZ with new details since the issue appears to be caused by a deadlock during client shutdown and not during runtime.