After crash, it leaves lock files. Must reboot to run again.

Sebastian Spaeth Sebastian at SSpaeth.de
Wed Sep 7 14:47:31 BST 2011


On Tue, 6 Sep 2011 11:29:10 -0700 (PDT), chris coleman <christocoleman at yahoo.com> wrote:
> After the crash: offlineimap failed to start again. It gave an error like "Another offlineimap is currently running, so this one will exit now, so as to avoid corrupting any data..."  

AFAIK the fcntl lock goes away when the process goes away that kept the
file open (even if the file still exists). So if it claims that it could
not take a lock that sounds more like a kernel bug (or another
offlineimap that was still running somewhere?) than anything else. Locks
are certainly gone after I -SIGKILL an OfflineImap process here.

> The problem was: offlineimap was stalled for far too long (hours) and was going to stay stuck waiting forever for a response from the remote server, because the net connection dropped while sync'ing 10 or 20 messages, then the net reconnected, and it still was waiting on the old connection but would never see it.  It had to be made to restart.

It hang for hours? I find that more troublesome than our locking
implementation to be honest. Do you have more details?

> By default, file locking on unix/linux is ADVISORY.  "Mandatory locks have no effect on the unlink function. As a result, certain programs may, effectively, circumvent mandatory locking. The authors of Advanced Programming in the UNIX Environment (Second Edition) observed that the ed editor did so (page 456)."

Your above quote shows that you can delete (unlink) an file with a
mandatory lock just fine, so I don't think your plan would work out.

> Is it possible the implementation of locking in offlineimap might be
> based on mandatory locking, not advisory locking ?

I don't see how mandatory locks would improve over the situation that
you are in, it would not change anything. But in any case, we won't be
able to remount your file system just because we want to use it :-):

"To enable mandatory locking, you must first mount the filesystem with
the mand mount option"
[http://www.hackinglinuxexposed.com/articles/20030623.html]

And this doesn't sound too nice either:
"Not even root can override a mandatory lock, so runaway processes can wreak
havoc if they lock crucial files." [http://www.mjmwired.net/kernel/Documentation/filesystems/mandatory-locking.txt]

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110907/8f24b1d1/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list