summaryrefslogtreecommitdiff
path: root/mailman/queue
diff options
context:
space:
mode:
authorBarry Warsaw2008-03-12 21:22:48 -0400
committerBarry Warsaw2008-03-12 21:22:48 -0400
commit276df8d3a8e89013490d7048b21ddc87e75a38ac (patch)
tree3a9a4e50a7c6a7ee2829d37127a5ff4522089a62 /mailman/queue
parent91f84edd80b4470cb0c9dfca30890388af6daec8 (diff)
downloadmailman-276df8d3a8e89013490d7048b21ddc87e75a38ac.tar.gz
mailman-276df8d3a8e89013490d7048b21ddc87e75a38ac.tar.zst
mailman-276df8d3a8e89013490d7048b21ddc87e75a38ac.zip
Sprinkle a few more transaction API calls around to make sure the database
doesn't remain in a locked state, hosing other processes. - Move a commit to the end of StockDatabase._create() - Add an abort to the Exception clause if there's an error while dequeuing - Add an abort to the Exception clause if there's an error while finishing - Add a commit after _doperiodic() and _shortcircuit() is called. - Add a commit to the end of cleaning_teardown() in test_documentation.py This now makes all the tests pass even when all of them are run.
Diffstat (limited to 'mailman/queue')
-rw-r--r--mailman/queue/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mailman/queue/__init__.py b/mailman/queue/__init__.py
index fb6b07479..e30608138 100644
--- a/mailman/queue/__init__.py
+++ b/mailman/queue/__init__.py
@@ -274,6 +274,7 @@ class Runner:
log.error('Skipping and preserving unparseable message: %s',
filebase)
self._switchboard.finish(filebase, preserve=True)
+ config.db.abort()
continue
try:
self._onefile(msg, msgdata)
@@ -303,11 +304,13 @@ class Runner:
log.error('SHUNTING FAILED, preserving original entry: %s',
filebase)
self._switchboard.finish(filebase, preserve=True)
- # Other work we want to do each time through the loop
+ config.db.abort()
+ # Other work we want to do each time through the loop.
Utils.reap(self._kids, once=True)
self._doperiodic()
if self._shortcircuit():
break
+ config.db.commit()
return len(files)
def _onefile(self, msg, msgdata):