Bug #666327 - IMAP deadlock when moving message and checking new mail
authorAlban Browaeys <prahal@yahoo.com>
Thu, 31 May 2012 12:33:03 +0000 (14:33 +0200)
committerMilan Crha <mcrha@redhat.com>
Thu, 31 May 2012 12:33:03 +0000 (14:33 +0200)
commit7a4162dcc372fbca2405056f92eef7bec4c7400f
tree0944819f0edba2cd44ebde737c682780736d2b40
parent1319e8280d825926668b5632c7e202d9ebb4d36f
Bug #666327 - IMAP deadlock when moving message and checking new mail

with service lock removal the fix for bug #666327
went out (commit 74fcab535c0f50a27742c05e94036b8370ea9173).
Was a good thing as this version is less a hack.
To summarize:
imap folder deadlock:
1. do_copy :
.imap command on source lock the imap store
2. camel_imap_folder_fetch_data on destination:
. lock the destination folder
3. do_copy :
. call the hande user tag : wait for lock on the destination
folder cache .
4. camel_imap_folder_fetch_data on destination:
. wait for lock on the imap store to be freed.

Fix: get the lock on the destination folder cache before locking the
imap store (ie before calling the imap command).
camel/providers/imap/camel-imap-folder.c