nmh-workers
[Top] [All Lists]

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

2017-01-03 23:27:05
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

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>