aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2016-11-16 15:27:10 -0800
committerMark Sapiro <mark@msapiro.net>2016-11-16 15:27:10 -0800
commit38575a69e772c1f35089b780c8317d9e8c4adf5f (patch)
tree1ae9ef695af7683a507291b8f0ad305707794ea2
parent5b7885a8666e980b6d8299ae32d6131de83b66c4 (diff)
downloadmailman2-38575a69e772c1f35089b780c8317d9e8c4adf5f.tar.gz
mailman2-38575a69e772c1f35089b780c8317d9e8c4adf5f.tar.xz
mailman2-38575a69e772c1f35089b780c8317d9e8c4adf5f.zip
Enhanced the fix for race conditions in MailList().Load().
-rwxr-xr-xMailman/MailList.py6
-rw-r--r--NEWS2
2 files changed, 6 insertions, 2 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 99cbbd2f..d1dc17a4 100755
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -634,6 +634,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
if e.errno <> errno.ENOENT: raise
# The file doesn't exist yet
return None, e
+ now = int(time.time())
try:
try:
dict = loadfunc(fp)
@@ -645,8 +646,9 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
finally:
fp.close()
# 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())
+ # so the test above might succeed the next time. And we get the time
+ # before unpickling in case it takes more than a second. (LP: #266464)
+ self.__timestamp = now
return dict, None
def Load(self, check_version=True):
diff --git a/NEWS b/NEWS
index 5ea05a7d..4946ae24 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,8 @@ Here is a history of user visible changes to Mailman.
Bug fixes and other patches
+ - Enhanced the fix for race conditions in MailList().Load(). (LP: #266464)
+
- Fixed a typo in Utils.py that could have resulted in a NameError in
logging an unlikely occurrence. (LP: #1637745)