do not configure worker specific items in init

this further corrects some issues with coordination. the basic issue
is described in a bug i fixed a while ago[1]. basically everything
defined in init is sort shared by workers. if it's unique to a worker
it should not be defined in init.

the weird addition to stop() is to maintain bug1418793[2]

[1] I2ad05e2085c0c0f78653c6354d301d18b8dee121
[2] Ied2f086e1f50950b430095ae7ee89036fd4a89d9

Change-Id: I979fdcd350c9a3a0fb6c02e831f1a450133ef76a
Closes-Bug: #1533787
This commit is contained in:
gordon chung 2016-01-28 17:09:29 -05:00
parent 67e47cda8e
commit 7dbaf4c207
1 changed files with 10 additions and 9 deletions

View File

@ -88,13 +88,6 @@ class NotificationService(service_base.BaseService):
NOTIFICATION_NAMESPACE = 'ceilometer.notification'
NOTIFICATION_IPC = 'ceilometer-pipe'
def __init__(self, *args, **kwargs):
super(NotificationService, self).__init__(*args, **kwargs)
self.partition_coordinator = None
self.listeners, self.pipeline_listeners = [], []
self.coord_lock = threading.Lock()
self.group_id = None
@classmethod
def _get_notifications_manager(cls, pm):
return extension.ExtensionManager(
@ -143,6 +136,9 @@ class NotificationService(service_base.BaseService):
def start(self):
super(NotificationService, self).start()
self.partition_coordinator = None
self.coord_lock = threading.Lock()
self.listeners, self.pipeline_listeners = [], []
self.pipeline_manager = pipeline.setup_pipeline()
@ -284,9 +280,14 @@ class NotificationService(service_base.BaseService):
self.pipeline_listeners.append(listener)
def stop(self):
if self.partition_coordinator:
if getattr(self, 'partition_coordinator', None):
self.partition_coordinator.stop()
utils.kill_listeners(self.listeners + self.pipeline_listeners)
listeners = []
if getattr(self, 'listeners', None):
listeners.extend(self.listeners)
if getattr(self, 'pipeline_listeners', None):
listeners.extend(self.pipeline_listeners)
utils.kill_listeners(listeners)
super(NotificationService, self).stop()
def reload_pipeline(self):