Cyrus 2.4.X delete mailbox oddities

Bron Gondwana brong at fastmail.fm
Tue Jun 28 09:18:57 EDT 2011


On Tue, 28 Jun 2011 15:05 +0200, "Bron Gondwana" <brong at fastmail.fm> wrote:
> On Tue, 28 Jun 2011 14:42 +0200, "Bron Gondwana" <brong at fastmail.fm> wrote:
> > Ok, so that's annoying.  LOGOUT doesn't clean up after itself.
> > That's definitely a bug.  I'll see what I can do about that.
> 
> Ahh, yeah - we don't read the cyrus.index again on shutdown, so we
> don't notice that the flag has been set.  That kind of sucks.  I
> guess the workaround would be to take a readonly trylock during
> mailbox close and re-read the header.  Hmm.  I'll see how much code
> that would take.

Answer: not much

+    /* get a re-read of the options field for cleanup purposes */
+    if (!mailbox->index_locktype)
+       mailbox_lock_index(mailbox, LOCK_SHARED);

That's a non-speculative lock though, so it means the close could
wind up waiting when it didn't strictly need to.  A better solution
would be to have a non-blocking read-only lock type.  But we don't
have one of those.  This will be fine though - usually the lock
will succeed anyway, and this will only occur when we're doing a
an imapd deselect, because pretty much every other case the index
is already locked going in to the close.

Bron.
-- 
  Bron Gondwana
  brong at fastmail.fm



More information about the Info-cyrus mailing list