diff options
author | bwarsaw <> | 2003-11-21 02:54:52 +0000 |
---|---|---|
committer | bwarsaw <> | 2003-11-21 02:54:52 +0000 |
commit | 64767fb00bf81dc5d02b4bc02b78f9034768a170 (patch) | |
tree | 851cdeadcc8d3262da6f49e0ec57bfc06b95540b /Mailman/Queue | |
parent | 461caf03bd3cd33ef8521821a3550537781de7da (diff) | |
download | mailman2-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.py | 4 |
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 |