Cells: Error unlocking instances

Bug #1257168 reported by Sam Morrison on 2013-12-03
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Sam Morrison

Bug Description

Getting the following error when trying to unlock an instance

2013-12-03 15:14:31.198 31688 DEBUG nova.compute.api [req-266c1f02-b77c-440a-8983-948f6ab2357c 671dcaba8087487c8a28afe42b6672fa e4eee8dbc16a49dcbc76edac96674e96] [instance: fb468a1d-2e64-4560-850d-31a5fd698305] Unlocking unlock /usr/lib/python2.7/dist-packages/nova/compute/api.py:2612
2013-12-03 15:14:31.200 31688 ERROR nova.cells.messaging [req-266c1f02-b77c-440a-8983-948f6ab2357c 671dcaba8087487c8a28afe42b6672fa e4eee8dbc16a49dcbc76edac96674e96] Error processing message locally: Object '<Instance at 0x5948a90>' is already attached to session '1247' (this is '1248')
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging Traceback (most recent call last):
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/nova/cells/messaging.py", line 205, in _process_locally
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging resp_value = self.msg_runner._process_message_locally(self)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/nova/cells/messaging.py", line 1476, in _process_message_locally
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging return fn(message, **message.method_kwargs)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/nova/cells/messaging.py", line 708, in run_compute_api_method
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging return self._run_api_method(message, method_info, fn)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/nova/cells/messaging.py", line 702, in _run_api_method
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging return fn(message.ctxt, *args, **method_info['method_kwargs'])
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 198, in wrapped
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging return func(self, context, target, *args, **kwargs)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 2615, in unlock
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging instance.save()
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/nova/openstack/common/db/sqlalchemy/models.py", line 52, in save
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging session.add(self)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1399, in add
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging self._save_or_update_state(state)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1411, in _save_or_update_state
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging self._save_or_update_impl(state)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1667, in _save_or_update_impl
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging self._update_impl(state)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1661, in _update_impl
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging self._attach(state)
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1749, in _attach
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging state.session_id, self.hash_key))
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging InvalidRequestError: Object '<Instance at 0x5948a90>' is already attached to session '1247' (this is '1248')
2013-12-03 15:14:31.200 31688 TRACE nova.cells.messaging

Matt Riedemann (mriedem) on 2013-12-08
tags: added: cells
Sam Morrison (sorrison) wrote :
Changed in nova:
assignee: nobody → Sam Morrison (sorrison)
status: New → In Progress

Reviewed: https://review.openstack.org/89487
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fb9b60fb5d3084d4cab29936fd1f534e5599f231
Submitter: Jenkins
Branch: master

commit fb9b60fb5d3084d4cab29936fd1f534e5599f231
Author: Sam Morrison <email address hidden>
Date: Tue Apr 22 16:34:26 2014 +1000

    Remove cell api overrides for lock and unlock

    This isn't actually needed as these methods handle objects and is
    triggered when the instance object is saved.
    It actually caused a race condition with unlock as it triggers 2
    instance updates from a compute cell.

    Change-Id: I42eea6a2984f70527d4fc37f48ad973a2248721c
    Closes-Bug: #1257168

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-10-16
Changed in nova:
milestone: juno-2 → 2014.2
Mathieu Gagné (mgagne) wrote :

Note: OpenStack Nova Icehouse is also affected by this bug.
Fortunately, the fix proposed works fine with OpenStack Nova Icehouse.

tags: added: icehouse-backport-potential
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers