[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mailman-cvs
Subject:    [Mailman-checkins] CVS: mailman/Mailman/Queue OutgoingRunner.py,2.2,2.3
From:       Barry Warsaw <bwarsaw () users ! sourceforge ! net>
Date:       2001-06-28 4:19:32
[Download RAW message or body]

Update of /cvsroot/mailman/mailman/Mailman/Queue
In directory usw-pr-cvs1:/tmp/cvs-serv25199

Modified Files:
	OutgoingRunner.py 
Log Message:
DEAL_WITH_PERMFAILURES_EVERY: controls how often _doperiodic() will
try to deal with deferred permanent failures.

_doperiodic(): It can be a bit expensive to actually deal with
permanent failures every time through this loop, and we don't need
that level of accuracy.  So now we keep a counter and only process
permanent failures every DEAL_WITH_PERMFAILURES_EVERY times.  (Okay,
so this variable defaults to 1, but you get the idea. :)

Also, move the Save() inside the try clause.  I've decided that
finally clauses should only unlock the list, not try to save it.


Index: OutgoingRunner.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Queue/OutgoingRunner.py,v
retrieving revision 2.2
retrieving revision 2.3
diff -C2 -r2.2 -r2.3
*** OutgoingRunner.py	2001/06/27 18:04:19	2.2
--- OutgoingRunner.py	2001/06/28 04:19:30	2.3
***************
*** 29,33 ****
--- 29,37 ----
  from Mailman.Logging.Syslog import syslog
  
+ # This controls how often _doperiodic() will try to deal with deferred
+ # permanent failures.
+ DEAL_WITH_PERMFAILURES_EVERY = 1
  
+ 
  
  class OutgoingRunner(Runner):
***************
*** 37,40 ****
--- 41,45 ----
          # Maps mailing lists to (recip, msg) tuples
          self._permfailures = {}
+         self._permfail_counter = 0
  
      def _dispose(self, mlist, msg, msgdata):
***************
*** 93,96 ****
--- 98,107 ----
          # Periodically try to acquire the list lock and clear out the
          # permanent failures.
+         self._permfail_counter += 1
+         if self._permfail_counter < DEAL_WITH_PERMFAILURES_EVERY:
+             return
+         # Reset the counter
+         self._permfail_counter = 0
+         # And deal with the deferred permanent failures.
          for mlist in self._permfailures.keys():
              try:
***************
*** 102,106 ****
                      mlist.RegisterBounce(recip, msg)
                  del self._permfailures[mlist]
-             finally:
                  mlist.Save()
                  mlist.Unlock()
--- 113,117 ----
                      mlist.RegisterBounce(recip, msg)
                  del self._permfailures[mlist]
                  mlist.Save()
+             finally:
                  mlist.Unlock()


_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
http://mail.python.org/mailman/listinfo/mailman-checkins

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic