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

List:       mailman-cvs
Subject:    [Mailman-checkins] [Branch ~mailman-coders/mailman/2.1] Rev 1316: A
From:       noreply () launchpad ! net
Date:       2011-09-30 0:43:09
Message-ID: 20110930004309.30135.2508.launchpad () ackee ! canonical ! com
[Download RAW message or body]

------------------------------------------------------------
revno: 1316
committer: Mark Sapiro <msapiro@value.net>
branch nick: 2.1
timestamp: Thu 2011-09-29 16:39:46 -0700
message:
  A problem with the logic avoiding unnecessarily reloading a current list
  object from the config.pck arises if the list is updated by another
  process within the same second that it was last read/written.  That can
  cause the reading of latest version of the list to be skipped.  This has
  been fixed.  Bug #862675.
modified:
  Mailman/MailList.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to https://code.launchpad.net/~mailman-c=
oders/mailman/2.1/+edit-subscription

["revision-diff.txt" (text/x-diff)]

=== modified file 'Mailman/MailList.py'
--- Mailman/MailList.py	2011-02-07 19:59:23 +0000
+++ Mailman/MailList.py	2011-09-29 23:39:46 +0000
@@ -599,8 +599,16 @@
             # file doesn't exist, we'll get an EnvironmentError with errno set
             # to ENOENT (EnvironmentError is the base class of IOError and
             # OSError).
+            # We test strictly less than here because the resolution is whole
+            # seconds and we have seen cases of the file being updated by
+            # another process in the same second.
+            # Even this is not sufficient in shared file system environments
+            # if there is time skew between servers.  In those cases, the test
+            # could be
+            # if mtime + MAX_SKEW < self.__timestamp:
+            # or the "if ...: return" just deleted.
             mtime = os.path.getmtime(dbfile)
-            if mtime <= self.__timestamp:
+            if mtime < self.__timestamp:
                 # File is not newer
                 return None, None
             fp = open(dbfile)
@@ -618,8 +626,9 @@
                 return None, e
         finally:
             fp.close()
-        # Update timestamp
-        self.__timestamp = mtime
+        # Update the timestamp.  We use current time here rather than mtime
+        # so the test above might succeed the next time.
+        self.__timestamp = int(time.time())
         return dict, None
 
     def Load(self, check_version=True):

=== modified file 'NEWS'
--- NEWS	2011-09-16 00:21:55 +0000
+++ NEWS	2011-09-29 23:39:46 +0000
@@ -66,6 +66,12 @@
 
   Bug Fixes and other patches
 
+    - A problem with the logic avoiding unnecessarily reloading a current list
+      object from the config.pck arises if the list is updated by another
+      process within the same second that it was last read/written.  That can
+      cause the reading of latest version of the list to be skipped.  This has
+      been fixed.  Bug #862675.
+
     - Fixed bin/export.py to accept case insensitive password schemes.
       Bug #833134.
 



_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/mailman-cvs%40progressive-comp.com



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

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