The commit 286a6ea8 replace the SIGHUP by a SIGTERM.
$ git show 286a6ea8
commit 286a6ea80dd4419137d8c35c7db6a0f687027418
Author: Marian Horban <email address hidden>
Date: Thu Sep 17 10:54:02 2015 -0400
Termination children on SIGHUP added
Reloading of application can be performed by sending HUP signal to
master process. But it is not useful right now because there should
be implemented many lines of code to support real reloading for each
of config options, and of course it is not implemented.
The easiest way to achieve reloading and applying configuration is
gracefully stop children and then respawn them.
When master process receives HUP signal it reloads it own
configuration, sends TERM signal to children to shutdown them
gracefully and respawns new children with updated config.
There is no impact on the user because sockets are still listening
in master process. So new requests will be put in queue.
If you look at this line https:/ /github. com/openstack/ oslo.service/ blob/master/ oslo_service/ service. py#L668 you can see that a break are realised on SIGHUP so we don't make another shutdown.
The commit 286a6ea8 replace the SIGHUP by a SIGTERM.
$ git show 286a6ea8 137d8c35c7db6a0 f687027418
commit 286a6ea80dd4419
Author: Marian Horban <email address hidden>
Date: Thu Sep 17 10:54:02 2015 -0400
Termination children on SIGHUP added
Reloading of application can be performed by sending HUP signal to
master process. But it is not useful right now because there should
be implemented many lines of code to support real reloading for each
of config options, and of course it is not implemented.
The easiest way to achieve reloading and applying configuration is
gracefully stop children and then respawn them.
When master process receives HUP signal it reloads it own
configuration, sends TERM signal to children to shutdown them
gracefully and respawns new children with updated config.
There is no impact on the user because sockets are still listening
in master process. So new requests will be put in queue.
Change-Id: I3e7264a1efcbf6 6a9afc69d8ed20f 600c985c296
diff --git a/oslo_ service/ service. py b/oslo_ service/ service. py service/ service. py service/ service. py (object) :
service. reset()
index 27cbed9..64b5f21 100644
--- a/oslo_
+++ b/oslo_
@@ -524,7 +524,7 @@ class ProcessLauncher
- os.kill(pid, signal.SIGHUP)
+ os.kill(pid, signal.SIGTERM)
diff --git a/oslo_
index 909a14c..db16297 100644
--- a/oslo_
+++ b/oslo_
@@ -215,15 +215,16 @@ class ServiceLauncher
+
+ def cond():
+ workers = self._get_workers()
+ return (len(workers) == len(start_workers) and
+ not set(start_
+
# Wait at most 5 seconds to respawn a worker
- cond = lambda: start_workers == self._get_workers()
- timeout = 5
+ timeout = 10
-
- # Make sure worker pids match
- end_workers = self._get_workers()
- LOG.info('workers: %r' % end_workers)
- self.assertEqua
+ self.assertTrue
class ServiceRestartT est(ServiceTest Base):