[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] File logs need to be flushed after each write. Zombies...



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

Modified Files:
	Common.py 
Log Message:
File logs need to be flushed after each write.  Zombies must be reaped.

Index: Common.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Common.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Common.py	12 Dec 2002 19:56:46 -0000	1.32
+++ Common.py	15 Dec 2002 04:15:37 -0000	1.33
@@ -312,6 +312,7 @@
 	if self.file is None:
 	    return
         print >> self.file, "%s [%s] %s" % (_logtime(), severity, message)
+        self.file.flush()
 
 class _ConsoleLogHandler:
     """Helper class for logging: directs all log messages to a stderr-like
@@ -567,7 +568,7 @@
        this process next receives a SIGTERM."""
     terminateHooks.append(fn)
 
-def waitForChildren():
+def waitForChildren(onceOnly=0):
     """Wait until all subprocesses have finished.  Useful for testing."""
     while 1:
         try:
@@ -577,6 +578,8 @@
             break
         except e:
             print e, repr(e), e.__class__
+        if onceOnly:
+            return
 
 def _sigChldHandler(signal_num, _):
     '''(Signal handler for SIGCHLD)'''