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

Modified Files:
        CommandRunner.py 
Log Message:
_dispose(): Fil correctly pointed out that each of the
ParseMailCommands() calls in this runner need to be wrapped around a
catch of TimeOutError.


Index: CommandRunner.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Queue/CommandRunner.py,v
retrieving revision 2.12
retrieving revision 2.13
diff -C2 -d -r2.12 -r2.13
*** CommandRunner.py    15 Mar 2002 17:55:39 -0000      2.12
--- CommandRunner.py    15 Mar 2002 18:18:43 -0000      2.13
***************
*** 24,27 ****
--- 24,30 ----
  
  
+ # BAW: get rid of this when we Python 2.2 is a minimum requirement.
+ from __future__ import nested_scopes
+ 
  import re
  
***************
*** 55,77 ****
          # a key to which one was used.  BAW: The tojoin and toleave actions
          # are hacks!
          try:
              if msgdata.get('torequest'):
                  # Just pass the message off the command handler
!                 mlist.ParseMailCommands(msg, msgdata)
              elif msgdata.get('tojoin'):
                  del msg['subject']
                  msg['Subject'] = 'join'
                  msg.set_payload('')
!                 mlist.ParseMailCommands(msg, msgdata)
              elif msgdata.get('toleave'):
                  del msg['subject']
                  msg['Subject'] = 'leave'
                  msg.set_payload('')
!                 try:
!                     mlist.ParseMailCommands(msg, msgdata)
!                 except LockFile.TimeOutError:
!                     # We probably could not get the lock on the pending
!                     # database.  That's okay, we'll just try again later.
!                     return 1
              elif msgdata.get('toconfirm'):
                  mo = re.match(mm_cfg.VERP_CONFIRM_REGEXP, msg.get('to', ''))
--- 58,84 ----
          # a key to which one was used.  BAW: The tojoin and toleave actions
          # are hacks!
+         def parsecmd():
+             try:
+                 mlist.ParseMailCommands(msg, msgdata)
+             except LockFile.TimeOutError:
+                 # We probably could not get the lock on the pending
+                 # database.  That's okay, we'll just try again later.
+                 return 1
+             return 0
          try:
+             status = 0
              if msgdata.get('torequest'):
                  # Just pass the message off the command handler
!                 status = parsecmd()
              elif msgdata.get('tojoin'):
                  del msg['subject']
                  msg['Subject'] = 'join'
                  msg.set_payload('')
!                 status = parsecmd()
              elif msgdata.get('toleave'):
                  del msg['subject']
                  msg['Subject'] = 'leave'
                  msg.set_payload('')
!                 status = parsecmd()
              elif msgdata.get('toconfirm'):
                  mo = re.match(mm_cfg.VERP_CONFIRM_REGEXP, msg.get('to', ''))
***************
*** 82,87 ****
                      del msg['subject']
                      msg['Subject'] = 'confirm ' + mo.group('cookie')
!                 mlist.ParseMailCommands(msg, msgdata)
              mlist.Save()
          finally:
              mlist.Unlock()
--- 89,95 ----
                      del msg['subject']
                      msg['Subject'] = 'confirm ' + mo.group('cookie')
!                 status = parsecmd()
              mlist.Save()
+             return status
          finally:
              mlist.Unlock()


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to