Per-account locking

Daniel Shahaf d.s at
Mon Sep 19 21:05:08 BST 2011

Have you considered stamping a format number somewhere in metadatadir,
and have offlineimap check that number before writing anything into that

At least that would prevent similar problems going forward (since old
versions would see a too-new format number and abort).

Sebastian Spaeth wrote on Mon, Sep 19, 2011 at 09:47:50 +0200:
> I have now pushed the per-account locks to my 'next' branch. For
> backwards-compatability, the old global lock is still in place, so you
> won't benefit from this goodness. After some releases (next major
> number?) we can then decide to drop support for the old global lock by
> simply reverting commit 0d9565141765b8b23c1c723d325cf494e47cc80d.
> I know that Nicolas would have preferred some cleverer solution where we
> figure out the correct lock to use ourselves. But each time I tried, I
> ran into issues that required more brain than I was willing to use. So
> this is the 2nd-best compromise. Introduce new-style lock now and in a
> few months, we can drop the global one. (Or we could introduce a
> temporary setting that disables the global lock for those who know they
> won't be running an old offlineimap for sure).
> Sebastian
> Commit logs follow:
> commit 0d9565141765b8b23c1c723d325cf494e47cc80d
> Perform legacy global lock in addition to new per-account lock
> We simply lock OfflineImap the same global way that we have always done
> in addition to the previously implemented per-account lock. We can keep
> both systems in parallel and then after a few stable releases, drop the
> old-style global lock. by reverting this patch
> commit 89c705bb2656b8edf028ce569329a012b4515c3e
> Import OfflineImapError
> The next commit will make use of OfflineImapError but is transient (the
> old-style lock). The commit is supposed to be reverted after a few
> releases. So add the new import in a separate commit, because we might
> need this even when reverting the commit.
> commit c7938dc0819e0a14d1a97e2362e46daa86a7ce85
> Per-account locking
> Previously, we were simply locking offlineimap whenever it was
> running. Howver there is no reason why we shouldn't be able to invoke it
> in parallel, e.g. to synchronize several accounts in one offlineimap
> each.
> This patch implements the locking per-account, so that it is possible to
> sync different accounts at the same time. If in refresh mode, we will
> attempt to loop three times before giving up.
> This also fixes Debian bug #586655

> _______________________________________________
> OfflineIMAP-project mailing list
> OfflineIMAP-project at
> OfflineIMAP homepage:

More information about the OfflineIMAP-project mailing list