[Mailman-Developers] List locks not getting relinquished

Barry Warsaw barry at python.org
Thu Jan 22 15:03:45 EST 2004


On Wed, 2004-01-21 at 12:01, Chris Boulter wrote:

> This is interesting. Presumably a lock named
>         entrepreneurship.club.lock.pavo.9897.0
> would have been acquired by pid 9897. Looking at my locks, they do seem to
> have been acquired by processes which no longer exist (possibly sync_members
> processes started by my daemon then killed after the timeout).

So some other process is hanging onto the lock, or leaving a stale lock
before your first sync_members process gets killed.  The trick for you
is to figure out which process that is.  Try disabling your daemon's
killing of sync_members, but instead try to print the pid for the
process that thinks it has the lock.  Is that process still around?  Can
you trace it to see if it's still making progress?

> One way I hoped Mailman might resolve this would be to ignore locks older
> than a certain age, or delete these locks. I guess it doesn't have this
> function though (I couldn't find it in Defaults.py).

Mailman does break locks, but the default time out is 5 hours for list
locks.  Breaking locks is generally bad so it's not a good idea to lower
this a whole lot.  OTOH, no properly functioning Mailman process should
hold a list lock for that long (or even close).

> Also, I've boldly gone in and deleted Mailman/locks/*. If Mailman expects to
> find a master lock file and make links to it, could this approach to
> breaking locks be dangerous?

Breaking list locks is dangerous because it's the list lock that ensures
database consistency.  Mailman 2.1 uses a very simple
write-to-Python-pickle persistency mechanism which most definitely is
not multi-process safe.  Breaking the master lock won't completely hose
you since that just protects from multiple mailmanctl processes
starting.  If you don't run that command more than once, you should be
fine.

> Yes indeed. Thanks for your detailed comments. It sounds like I might have
> to do penance with the logger though.

Try not to have too much fun! :)

-Barry





More information about the Mailman-Developers mailing list