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

[minion-cvs] Make DeliveryQueue and PerAddressDeliveryQueue always c...



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

Modified Files:
	ServerQueue.py 
Log Message:
Make DeliveryQueue and PerAddressDeliveryQueue always call
_deliverMessages, even if they have no messages to deliver.

Previously, if there were no messages ready to deliver, we'd skip
self._deliverMessages instead of calling it with an empty message set.
Calling it regardless allows _deliverMessages to add message on its
own, for example to send link padding.

Also, comment out hyperverbose log messages.


Index: ServerQueue.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerQueue.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- ServerQueue.py	31 May 2004 01:03:49 -0000	1.42
+++ ServerQueue.py	27 Jul 2004 03:20:31 -0000	1.43
@@ -372,13 +372,13 @@
                 except CorruptedFile:
                     continue
                 if state.isPending():
-                    LOG.trace("     [%s] is pending delivery", h)
+                    #LOG.trace("     [%s] is pending delivery", h)
                     continue
                 elif state.isRemovable():
-                    LOG.trace("     [%s] is expired", h)
+                    #LOG.trace("     [%s] is expired", h)
                     self.removeMessage(h)
                 elif state.nextAttempt <= now:
-                    LOG.trace("     [%s] is ready for delivery", h)
+                    #LOG.trace("     [%s] is ready for delivery", h)
                     if state is None:
                         addr = None
                     else:
@@ -386,12 +386,12 @@
                     messages.append(PendingMessage(h,self,addr))
                     state.setPending(now)
                 else:
-                    LOG.trace("     [%s] is not yet ready for redelivery", h)
+                    #LOG.trace("     [%s] is not yet ready for redelivery", h)
+                    continue
         finally:
             self._lock.release()
 
-        if messages:
-            self._deliverMessages(messages)
+        self._deliverMessages(messages)
         self._repOK()
 
     def _deliverMessages(self, msgList):
@@ -680,25 +680,25 @@
                 except CorruptedFile:
                     continue
                 if state.isPending():
-                    LOG.trace("     [%s] is pending delivery", h)
+                    #LOG.trace("     [%s] is pending delivery", h)
                     continue
                 elif state.queuedTime + self.totalLifetime < now:
-                    LOG.trace("     [%s] is expired", h)
+                    #LOG.trace("     [%s] is expired", h)
                     self.removeMessage(h)
                     continue
                 addressState = self._getAddressState(state.address, now)
                 if addressState.nextAttempt <= now:
-                    LOG.trace("     [%s] is ready for next attempt on %s", h,
-                              state.address)
+                    #LOG.trace("     [%s] is ready for next attempt on %s", h,
+                    #          state.address)
                     messages.append(PendingMessage(h,self,state.address))
                     state.setPending(now)
                 else:
-                    LOG.trace("     [%s] will wait for next attempt on %s",h,
-                              state.address)
+                    #LOG.trace("     [%s] will wait for next attempt on %s",h,
+                    #          state.address)
+                    continue
         finally:
             self._lock.release()
 
-        if messages:
             self._deliverMessages(messages)
 
     def cleanQueue(self, secureDeleteFn=None):
@@ -723,7 +723,7 @@
                 mState = None
             if mState:
                 aState = self._getAddressState(mState.address, now)
-                changed = aState.succeeded(now=now)
+                aState.succeeded(now=now)
                 aState.setNextAttempt(self.retrySchedule, now)
                 self.addressStateDB[str(mState.address)] = aState