Re: imap MOVE produces duplicates due race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 18, 2021, at 23:08, Deniss / cyrus wrote:
hello,

I meet the issue with MOVE command race in concurrent sessions - with 
cyrus 2.5 it produces duplicates:

Yeah, don't do that.

MOVE is defined to work the same way as COPY + STORE + EXPUNGE, and if you issue two COPY commands in parallel sessions to copy to the same folder, you'll get duplicates, likewise if you store \Deleted to the same message twice, that's OK - and finally, if you issue EXPUNGE twice that will be fine too.

I guess we could make the MOVE code safer for this use case - but it would be Cyrus specific, because the standardard doesn't make any such guarantee.

This is one benefit of JMAP :)  You can use ifInState and hence get a guaranteed avoidance of parallel action.  But there's no way to get that guarantee via IMAP without an external locking mechanism.  You can clean the duplicates up in the destination folder by always deleting the one with the lower UID if you find a duplicate.  This also is easier in newer Cyrus because you can use the EMAILID property to know that it's a duplicate.

Bron.


--
  Bron Gondwana, CEO, Fastmail Pty Ltd
  brong@xxxxxxxxxxxxxxxx



[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux