[Mailman-Developers] Re: [Mailman-Users] Big problems with stale lockfiles on large list...
J C Lawrence
claw at kanga.nu
Wed May 2 10:48:43 CEST 2001
On Tue, 01 May 2001 21:28:03 -0700
Chuq Von Rospach <chuqui at plaidworks.com> wrote:
> On 5/1/01 8:52 PM, "Barry A. Warsaw" <barry at digicool.com> wrote:
>> I've avoid that because of NFS issues, i.e. if you've got
>> multiple Mailman installations sharing an NFS partition, the pids
>> aren't relevant.
> If you have that, don't you have chaos anyway? Is the create&link
> lock style reliable over NFS in the first place? Isn't putting
> locks from multiple machiens in the same directory just a plain
> old bad idea?
The only operation guaranteed as unique under NFS is creat(). That
pretty well limits the options.
> I ran into a strange little problem today -- I'm using time() to
> generate a filename for a temporary directory. Works great; until
> you start running multiple processes on a 2 CPU machine. I started
> having two processes get the same time() value (which is
> impossible on a single CPU system) and fight over the same
> directory. I'm now doing a random() based sleep to get away from
> this.
Bad bad bad bad. You've just decreased the incidence of collisions,
not their fact or possibility. The standard *nix approach is to use
the process ID which is guaranteed unique. If you're not running an
*ix, just have one process use numerically even tempfile names, and
the other odd.
--
J C Lawrence claw at kanga.nu
---------(*) http://www.kanga.nu/~claw/
--=| A man is as sane as he is dangerous to his environment |=--
More information about the Mailman-Users
mailing list