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

[minion-cvs] Include timezone in log messages; fail gracefully when ...



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

Modified Files:
	Modules.py 
Log Message:
Include timezone in log messages; fail gracefully when hitting process limit

Index: Modules.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/Modules.py,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- Modules.py	8 Jan 2004 23:07:32 -0000	1.69
+++ Modules.py	27 Jan 2004 05:13:36 -0000	1.70
@@ -13,6 +13,7 @@
             'DELIVER_OK', 'DELIVER_FAIL_RETRY', 'DELIVER_FAIL_NORETRY'
             ]
 
+import errno
 import os
 import re
 import sys
@@ -1348,7 +1349,13 @@
 
         cmd = self.command
         opts = self.options + (self.tmpQueue.getMessagePath(handle),)
-        code = os.spawnl(os.P_WAIT, cmd, cmd, *opts)
+        try:
+            code = os.spawnl(os.P_WAIT, cmd, cmd, *opts)
+        except OSError,e:
+            if e.errno not in (errno.EAGAIN, errno.ENOMEM): raise
+            LOG.warn("Transient error while running Mixmaster: %s",e)
+            return DELIVER_FAIL_RETRY
+
         LOG.debug("Queued Mixmaster message: exit code %s", code)
         self.tmpQueue.removeMessage(handle)
         return DELIVER_OK
@@ -1358,7 +1365,12 @@
            should be called after invocations of processMessage."""
         cmd = self.command
         LOG.debug("Flushing Mixmaster pool")
-        os.spawnl(os.P_WAIT, cmd, cmd, "-S")
+        try:
+            os.spawnl(os.P_WAIT, cmd, cmd, "-S")
+        except OSError,e:
+            if e.errno not in (errno.EAGAIN, errno.ENOMEM): raise
+            LOG.warn("Transient error while running Mixmaster: %s",e)
+            return DELIVER_FAIL_RETRY
 
 class _MixmasterSMTPModuleDeliveryQueue(SimpleModuleDeliveryQueue):
     """Delivery queue for _MixmasterSMTPModule.  Same as