Barry Warsaw pushed to branch sort-addresses at mailman / Mailman
Commits:
cc22f5b0 by Mark Sapiro at 2017-01-31T00:26:18+00:00
Fix typo LTMP -> LMTP.
- - - - -
36ffac9b by Mark Sapiro at 2017-01-31T01:04:13+00:00
Merge branch 'fix_typo' into 'master'
Fix typo LTMP -> LMTP.
See merge request !241
- - - - -
d113a345 by Barry Warsaw at 2017-02-01T20:12:02-05:00
Fix signal handler exception.
- - - - -
f9437b07 by Barry Warsaw at 2017-02-02T14:59:36+00:00
Merge branch 'fix-signals' into 'master'
Fix signal handler exception
See merge request !242
- - - - -
f403c53c by Barry Warsaw at 2017-02-02T20:23:33-05:00
Sort the addresses for predictable results.
- - - - -
9e82813c by Barry Warsaw at 2017-02-02T20:23:40-05:00
Merge branch 'sort-addresses' of gitlab.com:mailman/mailman into
sort-addresses
- - - - -
2 changed files:
- src/mailman/core/runner.py
- src/mailman/runners/docs/lmtp.rst
Changes:
=====================================
src/mailman/core/runner.py
=====================================
--- a/src/mailman/core/runner.py
+++ b/src/mailman/core/runner.py
@@ -92,23 +92,24 @@ class Runner:
signal.SIGINT: 'SIGINT',
signal.SIGUSR1: 'SIGUSR1',
}.get(signum, signum)
- if signum in (signal.SIGTERM, signal.SIGINT, signal.SIGUSR1):
+ if signum == signal.SIGHUP:
+ reopen()
+ rlog.info('%s runner caught SIGHUP. Reopening logs.', self.name)
+ elif signum in (signal.SIGTERM, signal.SIGINT, signal.SIGUSR1):
self.stop()
self.status = signum
rlog.info('%s runner caught %s. Stopping.', self.name, signame)
- elif signum == signal.SIGHUP:
- reopen()
- rlog.info('%s runner caught SIGHUP. Reopening logs.', self.name)
- # As of Python 3.5, PEP 475 gets in our way. Runners with long
- # time.sleep()'s in their _snooze() method (e.g. the retry runner) will
- # have their system call implemented time.sleep() automatically retried
- # at the C layer. The only reliable way to prevent this is to raise an
- # exception in the signal handler. The standard run() method
- # automatically suppresses this exception, meaning, it's caught and
- # ignored, but effectively breaks the run() loop, which is just what we
- # want. Runners which implement their own run() method must be
- # prepared to catch RunnerInterrupts, usually also ignoring them.
- raise RunnerInterrupt
+ # As of Python 3.5, PEP 475 gets in our way. Runners with long
+ # time.sleep()'s in their _snooze() method (e.g. the retry runner)
+ # will have their system call implemented time.sleep()
+ # automatically retried at the C layer. The only reliable way to
+ # prevent this is to raise an exception in the signal handler. The
+ # standard run() method automatically suppresses this exception,
+ # meaning, it's caught and ignored, but effectively breaks the
+ # run() loop, which is just what we want. Runners which implement
+ # their own run() method must be prepared to catch
+ # RunnerInterrupts, usually also ignoring them.
+ raise RunnerInterrupt
def set_signals(self):
"""See `IRunner`."""
=====================================
src/mailman/runners/docs/lmtp.rst
=====================================
--- a/src/mailman/runners/docs/lmtp.rst
+++ b/src/mailman/runners/docs/lmtp.rst
@@ -1,5 +1,5 @@
===========
-LTMP server
+LMTP server
===========
Mailman can accept messages via LMTP (RFC 2033). Most modern mail servers
View it on GitLab:
https://gitlab.com/mailman/mailman/compare/7e0e6f2b0fdfd53a2449746ff61e04a1ec91959a...9e82813c1a802b52c9bc97da4e3038b8687cddc0
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org