[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Bug 29] Use explicit values for blocking=0/1 for Lockfi...



Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv29341/lib/mixminion/server

Modified Files:
	ServerMain.py 
Log Message:
[Bug 29] Use explicit values for blocking=0/1 for Lockfile.acquire.
It turns out that the default behavior (blocking=0) did _not_ obey the
threading.*Lock interface, which in turn threw ClientDirectory for a
loop.

If the directory tried to acquire the lock, and there was contention,
it would die with an exception.  Not any more, I hope.

In 0.0.8, we should change Lockfile to Do The Right Thing.


Index: ServerMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerMain.py,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- ServerMain.py	23 Mar 2004 00:35:07 -0000	1.123
+++ ServerMain.py	23 Mar 2004 05:15:17 -0000	1.124
@@ -677,7 +677,7 @@
             os.makedirs(os.path.split(self.pidFile)[0], 0700)
         self.lockFile = Lockfile(self.pidFile)
         try:
-            self.lockFile.acquire(mode=0644)
+            self.lockFile.acquire(mode=0644,blocking=0)
         except LockfileLocked:
             raise UIError("Another server seems to be running.")