> Oops --- there's a big fwack of the problem; why unlink the tmp file?
> This problem would disappear with two changes, simple to describe
> (though I don't know how they will be to implement). First one is,
> don't unlink that tmp file; the lock attempt loop should have just
> two syscalls, link(2) and sleep(3).
>
> And second, that loop, like any retry loop, should be using exponential
> backoff. Personally I don't like **2 backoff; fibo is quick enough,
> and even cheaper to compute.
>
> This pair of fixes will basically take care of procmail's part of
> the problem, though making sure you acquire a kernel lock (if kernel
> locks are available) before attempting to create the dotlock file
> would help with the remaining problem.
Those are two very good ideas, I think. I think that procmail
does use kernel locks too if you let it, but I've turned them off in
config.h to avoid any problems with locking over NFS.
--
Gjermund Sorseth