summaryrefslogtreecommitdiff
path: root/Mailman/LockFile.py
diff options
context:
space:
mode:
authorbwarsaw1998-12-18 00:22:23 +0000
committerbwarsaw1998-12-18 00:22:23 +0000
commitbb33f15b3902e04e62762ca662849338f3cf26b2 (patch)
tree43ae7cd67088b326162b988ce7d665740a193f82 /Mailman/LockFile.py
parent5007ccd8145bf43ed088692bab03c33fe097a7ec (diff)
downloadmailman-bb33f15b3902e04e62762ca662849338f3cf26b2.tar.gz
mailman-bb33f15b3902e04e62762ca662849338f3cf26b2.tar.zst
mailman-bb33f15b3902e04e62762ca662849338f3cf26b2.zip
Significantly rewritten to handle many lurking bugs.
- reorganized into functions with a small amount of __main__ code - re-ordered the way the work gets done between the parent and the child. it was possible the gate_watermarks file would be continuously trashed because it was written by every child process, which run asynchronously. now only the parent writes this file, but it does so after each list's gating child process starts. This also means that the parent is what makes the initial NNTP connection, and gets the stats of the list (e.g. first and last). These it passes to the child process, along with the current watermark. The child just does the actual gating. - Added a per-list locking file so that only one gate_news process will be gating a list at any one time. What happens is: the parent acquires the per-list lock. If that fails, it just moves on to the next list; gate_news runs again in 5 minutes anyway, and the hung_timeout on the lock is set to 4 minutes. If the parent gets the per-list lock, it forks a child to handle gating that list. The child then steals the lock from the parent (this should be safe), gates all the new messages, and then releases the per-list lock. This new code should be forking-safe, should not have run away processes, and lets you run gate_news from the command line without interfering with any cron spawned gate_news process.
Diffstat (limited to 'Mailman/LockFile.py')
0 files changed, 0 insertions, 0 deletions