diff options
| author | Barry Warsaw | 2011-08-15 22:05:22 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-08-15 22:05:22 -0400 |
| commit | 51319c7b0f1790b32ec360366ab3435b042363e2 (patch) | |
| tree | 8fe70a5f2f625788e35ce453c7bc4d6bce1d9f9c /src | |
| parent | 18c48f8660b70bf9c41cd4f24c2112ce719ff455 (diff) | |
| download | mailman-51319c7b0f1790b32ec360366ab3435b042363e2.tar.gz mailman-51319c7b0f1790b32ec360366ab3435b042363e2.tar.zst mailman-51319c7b0f1790b32ec360366ab3435b042363e2.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/docs/NEWS.rst | 2 | ||||
| -rw-r--r-- | src/mailman/runners/rest.py | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index b83c0186a..4a9e725bf 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -53,6 +53,8 @@ Testing ------- * New configuration variable in [devmode] section, called `wait` which sets the timeout value used in the test suite for starting up subprocesses. + * Handle SIGTERM in the REST server so that the test suite always shuts down + correctly. (LP: #770328) 3.0 alpha 7 -- "Mission" diff --git a/src/mailman/runners/rest.py b/src/mailman/runners/rest.py index 1e631c6a3..cc55001c7 100644 --- a/src/mailman/runners/rest.py +++ b/src/mailman/runners/rest.py @@ -44,15 +44,20 @@ class RESTRunner(Runner): def run(self): log.info('Starting REST server') + # Handle SIGTERM the same way as SIGINT. + def stop_server(signum, frame): + log.info('REST server shutdown') + sys.exit(signal.SIGTERM) + signal.signal(signal.SIGTERM, stop_server) try: make_server().serve_forever() except KeyboardInterrupt: log.info('REST server interrupted') - sys.exit(signal.SIGTERM) + sys.exit(signal.SIGINT) except select.error as (errcode, message): if errcode == errno.EINTR: log.info('REST server exiting') - sys.exit(signal.SIGTERM) + sys.exit(errno.EINTR) raise except: raise |
