You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In class AutorecoveringConnection:
maybeDeleteRecordedAutoDeleteExchange takes the locks on
- recordedExchanges
- consumers
maybeDeleteRecordedAutoDeleteQueue takes the locks on
- recordedQueues
- consumers
Since the latter one also calls the former, the following deadlock may occur
Thread1:
maybeDeleteRecordedAutoDeleteExchange
- locked recordedExchanges
- waiting for consumers (locked by thread2)
Thread2:
maybeDeleteRecordedAutoDeleteQueue
- locked recordedQueues
- locked consumers
maybeDeleteRecordedAutoDeleteExchange
- waiting for recordedExchanges (locked by thread1)
By reversing the locks, both flows will first lock consumers, avoiding taking other locks
in a different order
0 commit comments