diff options
| author | cotton | 1998-10-13 20:13:34 +0000 |
|---|---|---|
| committer | cotton | 1998-10-13 20:13:34 +0000 |
| commit | e8641a172f45b17b654332248994260a5041e867 (patch) | |
| tree | 062841e817b5a1523bcb5dcb67f17b3bb5dc3815 /Mailman/OutgoingQueue.py | |
| parent | 0b5104bccf3e3bdf8328987f29b9570e737327ef (diff) | |
| download | mailman-e8641a172f45b17b654332248994260a5041e867.tar.gz mailman-e8641a172f45b17b654332248994260a5041e867.tar.zst mailman-e8641a172f45b17b654332248994260a5041e867.zip | |
a little stress testing revealed a bug in OutgoingQueue: the processQueue
procedure assumed that files existed that it had recently found in the
directory listing, but they may have been dequeued by another process
between the time when the directory was listed and when processQueue
stats the file.
the fix is just to try: it and continue iff the file doesn't exist.
scott
Diffstat (limited to 'Mailman/OutgoingQueue.py')
| -rw-r--r-- | Mailman/OutgoingQueue.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Mailman/OutgoingQueue.py b/Mailman/OutgoingQueue.py index f5b9cbfc3..faedc5654 100644 --- a/Mailman/OutgoingQueue.py +++ b/Mailman/OutgoingQueue.py @@ -75,7 +75,24 @@ def processQueue(): if TEMPLATE != file[:len(TEMPLATE)]: continue full_fname = os.path.join(mm_cfg.DATA_DIR, file) - st = os.stat(full_fname) + # + # we need to stat the file if it still exists (atomically, we + # can't use use os.path.exists then stat. + # if it doesn't exist, it's been dequeued since we saw + # it in the directory listing + # + try: + st = os.stat(full_fname) + except os.error, rest: + try: + code, msg = rest + except ValueError: + code = "" + msg = str(rest) + if code == errno.ENOENT: # file does not exist, it's already been dequeued + continue + else: + raise os.error, rest # # if the file is not a deferred q message, we check to # see if the creation time was too long ago and process |
