james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Maurer <norman.mau...@googlemail.com>
Subject [MAILBOX and IMAP] Possible race-condition because of lazy fetching
Date Fri, 22 Jul 2011 17:30:07 GMT
Hi there,

today I tried to stress-test james IMAP and see how it behaves. During
this I noticed there is a possible race-condition when concurrent
access a mailbox from many clients.

So let me explain what happens:

* The first client fetch a ranges of mails (say 1:5000)
* The second client does at the same time set the \DELETED flag on
message with msn 4500 and then trigger "EXPUNGE".

If the second client was able to execute the EXPUNGE before the first
was trying to return message 4500 it will cause prolly cause problems
to client one. As it will maybe try to get the headers in lazy fashion
(like for example load them via JPA because they are declared via
@LOB). This will fail as these rows not exist anymore.

The same scenario can gives problems with maildir impls as the message
file may not exist anymore.

So to fix this we should prolly allow to Lock a Mailbox while
accessing data from it. The best would be a read and a write lock. So
we could be quick in read only cases. This will for sure add some
overhead but I think its the best todo.



To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message