Skip to content

Commit

Permalink
Handle multi-process SIGHUP correctly
Browse files Browse the repository at this point in the history
Child processes were returning to the main while loop
and spawning a next generation of processes. Instead
they should exit cleanly.

Fix for bug 1042823.

Change-Id: I8c0d150640c78487b43279a44d0d6d3ac3e386cc
  • Loading branch information
Stuart McLaren committed Sep 7, 2012
1 parent 8e17990 commit 3684d8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion glance/common/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ def run_child(self):
signal.signal(signal.SIGINT, signal.SIG_IGN)
self.run_server()
self.logger.info(_('Child %d exiting normally') % os.getpid())
return
# self.pool.waitall() has been called by run_server, so
# its safe to exit here
sys.exit(0)
else:
self.logger.info(_('Started child %s') % pid)
self.children.append(pid)
Expand Down

0 comments on commit 3684d8d

Please sign in to comment.