summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-04-22 14:57:53 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-04-22 15:01:07 -0500
commitb05274c96bc48e749e6ad21633b39158838c313e (patch)
treed418e04bbfd8fe0a9d322def27ede0bf9c0dbed9
parente1f92186656f91b0686264b0a8640ae13c9a0bcd (diff)
downloadcinder-b05274c96bc48e749e6ad21633b39158838c313e.tar.gz
service child process normal SIGTERM exit
service.py had some code where the child process would catch the SIGTERM from the parent just so it could exit with 1 status rather than with an indication that it exited due to SIGTERM. When shutting down the parent doesn't care in what way the child ended, only that they're all gone, so this code is unnecessary. Also, for some reason this caused the child to never exit while there was an open connection from a client. Probably something with eventlet and signal handling. This is a cherry-pick of oslo-incubator commit 702bc569987854b602ef189655c201c348de84cb . Change-Id: I87f3ca4da64fb8070e4d6c3876a2f1ce1a3ca71d Closes-Bug: #1446583 (cherry picked from commit d73ac96d18c66aa4dd5b7d7f8d7c22e8f8434683)
-rw-r--r--cinder/openstack/common/service.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/cinder/openstack/common/service.py b/cinder/openstack/common/service.py
index 910d2bbbc..c0701033e 100644
--- a/cinder/openstack/common/service.py
+++ b/cinder/openstack/common/service.py
@@ -234,15 +234,12 @@ class ProcessLauncher(object):
def _child_process_handle_signal(self):
# Setup child signal handlers differently
- def _sigterm(*args):
- signal.signal(signal.SIGTERM, signal.SIG_DFL)
- raise SignalExit(signal.SIGTERM)
-
def _sighup(*args):
signal.signal(signal.SIGHUP, signal.SIG_DFL)
raise SignalExit(signal.SIGHUP)
- signal.signal(signal.SIGTERM, _sigterm)
+ # Parent signals with SIGTERM when it wants us to go away.
+ signal.signal(signal.SIGTERM, signal.SIG_DFL)
if _sighup_supported():
signal.signal(signal.SIGHUP, _sighup)
# Block SIGINT and let the parent send us a SIGTERM