yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #17622
[Bug 1330431] Re: wrong lock name when operating instance events
** Changed in: nova
Status: Fix Committed => Fix Released
** Changed in: nova
Milestone: None => juno-2
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1330431
Title:
wrong lock name when operating instance events
Status in OpenStack Compute (Nova):
Fix Released
Bug description:
We use wrong lock name at here:
def prepare_for_instance_event(self, instance, event_name):
"""Prepare to receive an event for an instance.
This will register an event for the given instance that we will
wait on later. This should be called before initiating whatever
action will trigger the event. The resulting eventlet.event.Event
object should be wait()'d on to ensure completion.
:param instance: the instance for which the event will be generated
:param event_name: the name of the event we're expecting
:returns: an event object that should be wait()'d on
"""
@utils.synchronized(self._lock_name)
def _create_or_get_event():
if instance.uuid not in self._events:
self._events.setdefault(instance.uuid, {})
return self._events[instance.uuid].setdefault(
event_name, eventlet.event.Event())
LOG.debug('Preparing to wait for external event %(event)s',
{'event': event_name}, instance=instance)
return _create_or_get_event()
We should invoke self._lock_name, not pass it as name.
So will get log message as below:
2014-06-16 17:44:59.022 DEBUG nova.openstack.common.lockutils
[req-97211458-bae1-473b-a3ad-47fd153ae30a admin admin] Got semaphore
"<function _lock_name at 0x7fe6a7edec08>" from (pid=30672) lock
/opt/stack/nova/nova/openstack/common/lockutils.py:168
Same problem for pop_instance_event and clear_events_for_instance
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1330431/+subscriptions
References