From 64767fb00bf81dc5d02b4bc02b78f9034768a170 Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Fri, 21 Nov 2003 02:54:52 +0000 Subject: enqueue(): Always flush and sync the message file. --- Mailman/Queue/Switchboard.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3