RFC: Dovecot locking

Rob Browning rlb at defaultvalue.org
Sun Feb 20 10:47:32 PST 2011


Rob Browning <rlb at defaultvalue.org> writes:

> Rob Browning <rlb at defaultvalue.org> writes:
>
>> This is an unfinished patch to handle Dovecot locking, which is useful
>> if we'd like to support running notmuch directly on a Dovecot Maildir:
>>
>>   http://wiki.dovecot.org/MailboxFormat/Maildir#Locking
>>
>> For now, I'm interested in general comments, i.e. is this desirable, is
>> it a reasonable approach, etc.  As you can see, there's no config
>> handling yet, so -llockfile is added unconditionally.
>
> Oh, and as Austin reminded me, I forgot to mention that liblockfile may
> or may not be appropriate (algorithmically).  I'm planning to check and
> see how Dovecot handles stale files -- lockfile_create() assumes that
> any file older than five minutes is stale.

It looks like dovecot's interval is 10 seconds, so for this to work
right, notmuch will need to call lockfile_touch() more often than that.

  /* How often to touch the uidlist lock file when it's locked.
     This is done both when using KEEP_LOCKED flag and when syncing a large
     maildir. */
  #define MAILDIR_LOCK_TOUCH_SECS 10

As yet, I don't know if that's likely to be easy to add.

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4


More information about the notmuch mailing list