[Mailman-Users] flock errors via cron

scott cotton scott at chronis.pobox.com
Thu Feb 4 19:32:00 CET 1999


The underlying problem is this:  the flock module has a
default timeout that when passed causes a lock to be
stolen.  That default timeout is a good value for most
operations, but not for long running operations like
run_queue. 

So the change is simply to give it a long enought time out
value.  This can be done by alterning the file
Mailman/OutgoingQueue.py like so:

look for the function "processQueue".  in the first few
lines there is something like:
      lock_file = flock.FileLock(somepath)

this should be changed to have an extra argument indicating
a reasonable timeout for running the queue:

      lock_file = flock.FileLock(somepath, 14400)

is an example.

scott

On Thu, Feb 04, 1999 at 12:00:28PM -0600, Christopher Lindsey wrote:
| Howdy all,
| 
|    Every time that $prefix/cron/run_queue is executed I get a 
|    mail message with errors:
| 
|       Traceback (innermost last):
|         File "/home/staff/mailman/cron/run_queue", line 31, in ?
|           OutgoingQueue.processQueue()
|         File "/home/staff/mailman/Mailman/OutgoingQueue.py", line 86, in processQueue
|           lock_file.lock()
|         File "/home/staff/mailman/Mailman/flock.py", line 119, in lock
|           os.link(self.lockfile, self.tmpfname)
|       os.error: (2, 'No such file or directory')
| 
|    This is on a Linux 2.0.30 system with Python 1.5.1.  The file system
|    is local, but exported via NFS with version 2.2beta37 of Olaf
|    Kirch's "Universal NFS server".
| 
|    I've never done any programming in Python, so I'm hoping that
|    someone will have an immediate answer before I'm forced to immerse
|    myself in the task of learning yet *another* language.  :)
| 
| Thanks,
| 
| Chris (who longs for the days of low-level programming again)
| 
| ------------------------------------------------------
| Mailman-Users maillist  -  Mailman-Users at python.org
| http://www.python.org/mailman/listinfo/mailman-users
| 




More information about the Mailman-Users mailing list