summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Pevec <apevec@redhat.com>2014-04-14 18:11:04 +0200
committerAlan Pevec <alan.pevec@redhat.com>2014-06-19 02:42:56 +0200
commit3dfb1d262ff65f3a165085b44322bd35e6469ce3 (patch)
tree095d501b32c31840b889f4dffb34cfa26b74d2d7
parent76f380632bbfb4596c90a70dd545282b072d0056 (diff)
downloadoslo-incubator-3dfb1d262ff65f3a165085b44322bd35e6469ce3.tar.gz
Move notification point to a better place
Follow-up for I80f325c9be9c171c2dc8d5526570bf64f0f87c78 "notify calling process we are ready to serve" Xavier Queralt found issue with sending readiness notification from inside run_service: it returns premature OK in case of multiple service endpoints in one systemd service like nova-api which by default provides osapi, ec2 and metadata services. Instead, send readiness notification before entering wait loop for each Launcher type. Change-Id: I69bf10f353f5fecaaf89e537c2d3c46b73e39d36 Implements: blueprint service-readiness (cherry picked from commit 356ecd4d9ab456f49c40cd6fb4e235fd18de0e19)
-rw-r--r--openstack/common/service.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/openstack/common/service.py b/openstack/common/service.py
index 60099e94..d286a2f9 100644
--- a/openstack/common/service.py
+++ b/openstack/common/service.py
@@ -190,6 +190,7 @@ class ServiceLauncher(Launcher):
return status, signo
def wait(self, ready_callback=None):
+ systemd.notify_once()
while True:
self.handle_signal()
status, signo = self._wait_for_exit_or_signal(ready_callback)
@@ -382,6 +383,7 @@ class ProcessLauncher(object):
def wait(self):
"""Loop waiting on children to die and respawning as necessary."""
+ systemd.notify_once()
LOG.debug('Full set of CONF:')
CONF.log_opt_values(LOG, std_logging.DEBUG)
@@ -488,7 +490,6 @@ class Services(object):
"""
service.start()
- systemd.notify_once()
done.wait()