procmail
[Top] [All Lists]

Re: locking

2006-10-29 12:40:12
On 10/28/06, ecocode <eco(_at_)ecocode(_dot_)net> wrote:

But then the question raises : how can procmail handle this kind of
situation without locking ?

It initially creates a temporary file with a unique name to store the
message, then uses atomic operations to rename that file to the final
delivery name.  It's theoretically possible that new messages could
continuously arrive so fast that one process could be forced to retry
forever in order to rename the temporary file to a valid final name,
but if you're getting that much mail you'll never read it all to begin
with.  Even in that case, though, the contents of two different
messages can never become interleaved within a single file (which is
the most common failure case in flat-file delivery in the absence of
locking).

This is equivalent to what happens with maildirs, except that maildir
uses the same "base name" but renames it among three different
directories.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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