From f5a94c7c2cdf090659689fb3194e7e045a1ea2d4 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 11 Jan 2013 14:11:08 -0500 Subject: Handle waiting for conductor in nova.service. Previously we were waiting for conductor to respond to a ping() in the compute manager. This patch moves this down to the base Service class. A nova service binary can indicate that db access is not allowed and if so, as soon as the service gets created, it will block while waiting for conductor to respond. The compute service has been updated to use this. This should not result in any real functional difference. The reason for this is that there is some database access that needs to be avoided down at this level. This allows us to divert these actions to conductor if needed. Part of bp no-db-compute. Change-Id: Idd6387b9428e3f9f4e4dbfe51293693238b2daf0 --- nova/compute/manager.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 98ed1286e..a517f8ffb 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -478,15 +478,12 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.warning(_('Hypervisor driver does not support ' 'firewall rules'), instance=instance) - def _get_instances_at_startup(self, context): - self.conductor_api.wait_until_ready(context) - return self.conductor_api.instance_get_all_by_host(context, self.host) - def init_host(self): """Initialization for a standalone compute service.""" self.driver.init_host(host=self.host) context = nova.context.get_admin_context() - instances = self._get_instances_at_startup(context) + instances = self.conductor_api.instance_get_all_by_host(context, + self.host) if CONF.defer_iptables_apply: self.driver.filter_defer_apply_on() -- cgit