aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Queue
diff options
context:
space:
mode:
authorbwarsaw <>2003-11-21 02:54:52 +0000
committerbwarsaw <>2003-11-21 02:54:52 +0000
commit64767fb00bf81dc5d02b4bc02b78f9034768a170 (patch)
tree851cdeadcc8d3262da6f49e0ec57bfc06b95540b /Mailman/Queue
parent461caf03bd3cd33ef8521821a3550537781de7da (diff)
downloadmailman2-64767fb00bf81dc5d02b4bc02b78f9034768a170.tar.gz
mailman2-64767fb00bf81dc5d02b4bc02b78f9034768a170.tar.xz
mailman2-64767fb00bf81dc5d02b4bc02b78f9034768a170.zip
enqueue(): Always flush and sync the message file.
Diffstat (limited to 'Mailman/Queue')
-rw-r--r--Mailman/Queue/Switchboard.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Mailman/Queue/Switchboard.py b/Mailman/Queue/Switchboard.py
index 6093623e..9853866d 100644
--- a/Mailman/Queue/Switchboard.py
+++ b/Mailman/Queue/Switchboard.py
@@ -117,7 +117,7 @@ class _Switchboard:
data['version'] = mm_cfg.QFILE_SCHEMA_VERSION
# Filter out volatile entries
for k in data.keys():
- if k[0] == '_':
+ if k.startswith('_'):
del data[k]
# Now write the message text to one file and the metadata to another
# file. The metadata is always written second to avoid race
@@ -129,6 +129,8 @@ class _Switchboard:
finally:
os.umask(omask)
msgfp.write(msgsave)
+ msgfp.flush()
+ os.fsync(msgfp.fileno())
msgfp.close()
# Now write the metadata using the appropriate external metadata
# format. We play rename-switcheroo here to further plug the race