nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] nmh should be more careful about when it unlinks draft


From: Ken Hornstein
Subject: Re: [Nmh-workers] nmh should be more careful about when it unlinks draft files
Date: Wed, 04 Jan 2017 00:08:43 -0500

>the error it signals up-stack must tell its caller why it fails, so
>that its caller can then try the next possible filename (message
>number). only if it fails N times in a row (suggest 6 or 42, from the
>prisoner and douglas adams) should comp then fail.
>
>this should be done for all file-creation including
>inc/refile/rcvstore/etc.

This is one of those things that once you start digging into it, it
becomes very complicated.

In general, things that use folder_addmsg() are safe, because that
actually uses link() to try to make a atomic filename allocation; if
that doesn't work it bumps up the message number by one.

So that means rcvstore and refile are okay, which is why we don't
have any file overwrites when people use rcvstore.  Also, this has
been better since we now have sequence locking.

inc does NOT use folder_addmsg, because the assumption is you're not
running that concurrently with rcvstore.

If we had everyone who used m_draft use the same protocol, that might
solve that problem.  We'd need to make sure everyone who adds messages
to a folder calls folder_addmsg(), though.  It ends up being a huge
pain to make sure we get it all right ... which is why it hasn't been done.

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]