------------------------------------------------------------
revno: 6727
committer: Barry Warsaw <[email protected]>
branch nick: 3.0
timestamp: Mon 2009-05-11 22:08:07 -0400
message:
Linux signal management appears to work differently than OS X. Introduce a
runner flag to indicate whether the qrunner parent process should intercept
signals or not. The REST server should not intercept signals.
modified:
src/mailman/bin/qrunner.py
src/mailman/interfaces/runner.py
src/mailman/queue/__init__.py
src/mailman/queue/rest.py
=== modified file 'src/mailman/bin/qrunner.py'
--- src/mailman/bin/qrunner.py 2009-05-10 20:13:02 +0000
+++ src/mailman/bin/qrunner.py 2009-05-12 02:08:07 +0000
@@ -226,7 +226,8 @@
def stop(self):
self._qrunner.stop()
loop = Loop(qrunner)
- set_signals(loop)
+ if qrunner.intercept_signals:
+ set_signals(loop)
# Now start up the main loop
log = logging.getLogger('mailman.qrunner')
log.info('%s qrunner started.', loop.name())
@@ -250,7 +251,8 @@
def isdone(self):
return self._isdone
loop = Loop()
- set_signals(loop)
+ if qrunner.intercept_signals:
+ set_signals(loop)
log.info('Main qrunner loop started.')
while not loop.isdone():
for qrunner in qrunners:
=== modified file 'src/mailman/interfaces/runner.py'
--- src/mailman/interfaces/runner.py 2009-01-17 02:04:21 +0000
+++ src/mailman/interfaces/runner.py 2009-05-12 02:08:07 +0000
@@ -47,6 +47,14 @@
`config.QRUNNER_SLEEP_TIME`
""")
+ intercept_signals = Attribute("""\
+ Should the qrunner mechanism intercept signals?
+
+ In general, the qrunner catches SIGINT, SIGTERM, SIGUSR1, and SIGHUP
+ to manage the process. Some qrunners need to manage their own
+ signals, and set this attribute to False.
+ """)
+
def _one_iteration():
"""The work done in one iteration of the main loop.
=== modified file 'src/mailman/queue/__init__.py'
--- src/mailman/queue/__init__.py 2009-02-13 01:36:21 +0000
+++ src/mailman/queue/__init__.py 2009-05-12 02:08:07 +0000
@@ -281,6 +281,8 @@
class Runner:
implements(IRunner)
+ intercept_signals = True
+
def __init__(self, name, slice=None):
"""Create a queue runner.
=== modified file 'src/mailman/queue/rest.py'
--- src/mailman/queue/rest.py 2009-05-10 20:13:02 +0000
+++ src/mailman/queue/rest.py 2009-05-12 02:08:07 +0000
@@ -40,6 +40,8 @@
class RESTRunner(Runner):
+ intercept_signals = False
+
def run(self):
log.info('Starting REST server')
try:
--
Primary development focus
https://code.launchpad.net/~mailman-coders/mailman/3.0
Your team Mailman Checkins is subscribed to branch lp:mailman.
To unsubscribe from this branch go to
https://code.launchpad.net/~mailman-coders/mailman/3.0/+edit-subscription.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org