Skip to content

Commit 1f1e016

Browse files
committed
update
1 parent 6e1a4a1 commit 1f1e016

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

Mailman/Queue/Switchboard.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -509,18 +509,8 @@ def _enqueue(self, filename, msg, msgdata, _plaintext):
509509
os.close(lock_fd)
510510
except OSError as e:
511511
if e.errno == errno.EEXIST:
512-
mailman_log('warning', 'Lock file exists for %s (full path: %s), waiting...', qfile, lockfile)
513-
# Wait for lock to be released
514-
for _ in range(10): # 10 attempts
515-
try:
516-
lock_fd = os.open(lockfile, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
517-
os.close(lock_fd)
518-
break
519-
except OSError:
520-
time.sleep(0.1)
521-
else:
522-
mailman_log('error', 'Could not acquire lock for %s (full path: %s) after 10 attempts', qfile, lockfile)
523-
raise
512+
mailman_log('warning', 'Lock file exists for %s (full path: %s)', qfile, lockfile)
513+
raise
524514
else:
525515
mailman_log('error', 'Failed to create lock file %s (full path: %s): %s\nTraceback:\n%s',
526516
qfile, lockfile, str(e), traceback.format_exc())

0 commit comments

Comments
 (0)