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

Modified Files:
      Tag: Release_2_0_1-branch
        Message.py 
Log Message:
Enqueue(): We need to be more careful to avoid a race condition, by
writing the message text to a tmp file, then rotating it into the real
file atomically.


Index: Message.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Message.py,v
retrieving revision 1.40
retrieving revision 1.40.2.1
diff -C2 -d -r1.40 -r1.40.2.1
*** Message.py  2 Aug 2000 02:00:13 -0000       1.40
--- Message.py  2 Apr 2002 22:08:02 -0000       1.40.2.1
***************
*** 178,186 ****
          dbfp.close()
          # If it doesn't already exist, or if the text of the message has
!         # changed, write the message file to disk.
          if not existsp or dirty:
!             msgfp = Utils.open_ex(msgfile, 'w')
              msgfp.write(text)
              msgfp.close()
  
  
--- 178,189 ----
          dbfp.close()
          # If it doesn't already exist, or if the text of the message has
!         # changed, write the message file to disk, but do it atomically so as
!         # not to hit a race condition with the qrunner.
          if not existsp or dirty:
!             tmpfile = msgfile + '.tmp'
!             msgfp = Utils.open_ex(tmpfile, 'w')
              msgfp.write(text)
              msgfp.close()
+             os.rename(tmpfile, msgfile)
  
  


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

Reply via email to