Great Circle Associates Majordomo-Workers
(April 1998)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: next... :)
From: Jason L Tibbitts III <tibbs @ hpc . uh . edu>
Date: 29 Apr 1998 18:09:38 -0500
To: majordomo-workers @ greatcircle . com
In-reply-to: Bryan Fullerton's message of Wed, 29 Apr 1998 18:38:28 -0400
References: <19980429183828.Y28454@samurai.com>

>>>>> "BF" == Bryan Fullerton <bryanf@samurai.com> writes:

BF> looks to me like it's doing an exclusive lock on _config, then not
BF> unlocking it before trying to do a shared lock on the same file.
BF> Unless there's an implied unlock somewhere?

You're essentially correct; the problem is that the Mj::Config::lock
implicitly loads/reloads the file if necessary, but neglects to note that
it has loaded the file.  Then when the first variable fetch comes along
(which happens to be inside the critical section) the get routine sees that
the file isn't yet loaded and so loads it.  This tries to acquire another
lock and hangs.

Try this (yes, one stupid line):

Index: lib/Mj/Config.pm
diff -u -r1.5 Config.pm
--- Config.pm   1998/04/12 07:35:51     1.5
+++ Config.pm   1998/04/29 23:04:52
@@ -721,6 +721,7 @@
   if ($self->{mtime} < (stat($name))[9]) {
     delete $self->{data};
     $self->{data} = do $name;
+    $self->{loaded} = 1;
   }
   
   # Note that we are locked

Good catch, BTW.

 - J<


Follow-Ups:
References:
  • next... :)
    From: Bryan Fullerton <bryanf@samurai.com>
Indexed By Date Previous: Please help me!
From: Jimmy Larrosa <jlarrosa@gye.satnet.net>
Next: Re: Majordomo2-alpha1 install problem
From: Wasim Juned <wasim@quito.ecuanex.net.ec>
Indexed By Thread Previous: Re: confirm_url, was Re: next... :)
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: Re: next... :)
From: Bryan Fullerton <bryanf@samurai.com>

Google
 
Search Internet Search www.greatcircle.com