Description
In AbstractDelegatingMailboxListener::event, firing the events inside the synchronized blocks causes a deadlock involving:
lock on HashMapDelegatingMailboxListener::listeners
(synchronized methods) lock on SelectedMailboxImpl
In my example, these 3 methods got interlocked:
AbstractDelegatingMailboxListener.addListener
SelectedMailboxImpl.msn
AbstractDelegatingMailboxListener.removeListener
My idea to fix it is basically to take the for loop on mListeners outside the synchronized block in org.apache.james.mailbox.store.AbstractDelegatingMailboxListener.event(Event). That will not make the propagated event processing in SelectedMailboxImpl hit the synchronized lock on listeners.
Attachments
Attachments
Issue Links
- is related to
-
JAMES-1411 PathLocker may cause deadlocks
- Closed
-
MAILBOX-183 readUidFile is taking too much time for large uid file and blocks other threads
- Closed