Update of /cvsroot/mailman/mailman/cron
In directory usw-pr-cvs1:/tmp/cvs-serv6855

Modified Files:
      Tag: Release_2_0_1-branch
        qrunner 
Log Message:
main(): Fix a race condition based on a disagreement with
Message.Enqueue() about the order of file writes.  The latter writes
the .db first and then the .msg, so we must ignore .db files and
trigger only off of the .msg files.  And we don't unlink orphaned .db
files, but we might unlink orphaned .msg files.


Index: qrunner
===================================================================
RCS file: /cvsroot/mailman/mailman/cron/Attic/qrunner,v
retrieving revision 1.18.2.3
retrieving revision 1.18.2.4
diff -C2 -d -r1.18.2.3 -r1.18.2.4
*** qrunner     18 Apr 2001 03:58:35 -0000      1.18.2.3
--- qrunner     2 Apr 2002 22:38:50 -0000       1.18.2.4
***************
*** 196,206 ****
          root, ext = os.path.splitext(os.path.join(mm_cfg.QUEUE_DIR, file))
          if ext == '.db':
!             # If the .db file has no corresponding .msg file, we might as well
!             # remove the .db file, since there's little we can do about it.
!             if not os.path.exists(root+'.msg'):
!                 syslog('qrunner', 'Unlinking orphaned .db file: %s.db' % root)
!                 os.unlink(root+'.db')
!             # just trigger off the .msg files
              continue
          # Have we exceeded either resource limit?
          if mm_cfg.QRUNNER_PROCESS_LIFETIME is not None and \
--- 196,206 ----
          root, ext = os.path.splitext(os.path.join(mm_cfg.QUEUE_DIR, file))
          if ext == '.db':
!             # Just trigger off the .msg files.  This may leave stale .db files
!             # in qfiles, but these can't be cleaned up without storing a
!             # timestamp and watching out for race conditions.
              continue
+         if not os.path.exists(root+'.db'):
+             syslog('qrunner', 'Unlinking orphaned .msg file: %s.msg' % root)
+             os.unlink(root+'.msg')
          # Have we exceeded either resource limit?
          if mm_cfg.QRUNNER_PROCESS_LIFETIME is not None and \


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

Reply via email to