Instantiate logger per process.
Using the logger instance that was created by the master process, caused deadlocks by processes trying to write log messages. This is here solved, by instantiating only after child process starts. Change-Id: I57384fa970c15f78bee67851da089db4731ccbf8 Story: 2005817 Task: 33561
This commit is contained in:
parent
42300efadf
commit
dfd0cc9d1e
@ -45,7 +45,7 @@ from vitrage import messaging
|
|||||||
from vitrage import rpc as vitrage_rpc
|
from vitrage import rpc as vitrage_rpc
|
||||||
from vitrage import storage
|
from vitrage import storage
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = None
|
||||||
|
|
||||||
# Supported message types
|
# Supported message types
|
||||||
WAIT_FOR_WORKER_START = 'wait_for_worker_start'
|
WAIT_FOR_WORKER_START = 'wait_for_worker_start'
|
||||||
@ -163,8 +163,10 @@ class GraphWorkersManager(cotyledon.ServiceManager):
|
|||||||
|
|
||||||
So that new/deleted templates are added/removed
|
So that new/deleted templates are added/removed
|
||||||
"""
|
"""
|
||||||
LOG.info("Worker processes - starting...")
|
|
||||||
self._submit_and_wait(self._all_queues, (WAIT_FOR_WORKER_START,))
|
self._submit_and_wait(self._all_queues, (WAIT_FOR_WORKER_START,))
|
||||||
|
global LOG
|
||||||
|
if not LOG:
|
||||||
|
LOG = log.getLogger(__name__)
|
||||||
LOG.info("Worker processes - ready!")
|
LOG.info("Worker processes - ready!")
|
||||||
|
|
||||||
def submit_template_event(self, event):
|
def submit_template_event(self, event):
|
||||||
@ -232,6 +234,9 @@ class GraphCloneWorkerBase(coord.Service):
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
global LOG
|
||||||
|
if not LOG:
|
||||||
|
LOG = log.getLogger(__name__)
|
||||||
super(GraphCloneWorkerBase, self).run()
|
super(GraphCloneWorkerBase, self).run()
|
||||||
self._entity_graph.notifier._subscriptions = [] # Quick n dirty
|
self._entity_graph.notifier._subscriptions = [] # Quick n dirty
|
||||||
self._init_instance()
|
self._init_instance()
|
||||||
|
Loading…
Reference in New Issue
Block a user