Remove unnecessary 'context' parameter from quotas reserve method call

Bug #1494653 reported by Rajesh Tailor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Rajesh Tailor
Kilo
Fix Released
Undecided
Unassigned

Bug Description

In patch [1] 'context' parameter was removed from quota-related remotable method signatures.
In patch [2] use of 'context' parameter was removed from quota-related remotable method calls.

Still there are some occurrances where 'context' parameter is passed to quotas.reserve method which is leading to error "ValueError: Circular reference detected".

For eg: while restarting nova-compute if there are any instance
whose vm_state is 'DELETED' but that instance is not marked as deleted in db. In that case, while calling _init_instance method it raises below error.

2015-09-08 00:36:34.133 ERROR nova.compute.manager [req-3222b8a4-0542-48cf-a2e1-c92e5fd91e5e None None] [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] Failed to complete a deletion
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] Traceback (most recent call last):
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/opt/stack/nova/nova/compute/manager.py", line 952, in _init_instance
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] self._complete_partial_deletion(context, instance)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/opt/stack/nova/nova/compute/manager.py", line 879, in _complete_partial_d
eletion
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] bdms = objects.BlockDeviceMappingList.get_by_instance_uuid(
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", lin
e 197, in wrapper
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] ctxt, self, fn.__name__, args, kwargs)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/opt/stack/nova/nova/conductor/rpcapi.py", line 246, in object_action
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] objmethod=objmethod, args=args, kwargs=kwargs)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/client.py", line 158, in call
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] retry=self.retry)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/transport.py", line 90, in _send
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] timeout=timeout, retry=retry)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 431, in send
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] retry=retry)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 399, in _send
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] msg = rpc_common.serialize_msg(msg)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/common.py", line 286, in serialize_msg
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] _MESSAGE_KEY: jsonutils.dumps(raw_msg)}
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/local/lib/python2.7/dist-packages/oslo_serialization/jsonutils.py", line 185, in dumps
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] return json.dumps(obj, default=default, **kwargs)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/lib/python2.7/json/__init__.py", line 250, in dumps
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] sort_keys=sort_keys, **kw).encode(obj)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] chunks = self.iterencode(o, _one_shot=True)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] return _iterencode(o, 0)
2015-09-08 00:36:34.133 TRACE nova.compute.manager [instance: 00c7a9ae-bff1-461f-ab95-0e8f15327536] ValueError: Circular reference detected

[1] https://review.openstack.org/#/c/164268/
[2] https://review.openstack.org/#/c/160499/

Changed in nova:
assignee: nobody → Rajesh Tailor (rajesh-tailor)
summary: - Remove 'context' parameter from quotas reserve method call
+ Remove unnecessary 'context' parameter from quotas reserve method call
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/222972

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 4031272fe93d1046cff4c0cc788c8e78db944419
Author: Rajesh Tailor <email address hidden>
Date: Thu Sep 10 23:15:46 2015 -0700

    Remove unnecessary 'context' param from quotas reserve method call

    context' parameter was removed from quota-related method signatures in patch [1].
    In patch [2] use of 'context' parameter was removed from quota-related method calls.

    Still at some places 'context' parameter was passed to quota reserve method call.

    Removed use of 'context' parameter from those places and passed 'context' as kwargs
    while creating object of nova.objects.Quotas type.

    [1] https://review.openstack.org/#/c/164268/
    [2] https://review.openstack.org/#/c/160499/

    Change-Id: I20ea77bd20f093ce1be7169c0647cdc7ff62117c
    Closes-Bug: 1494653

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/223968

Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-rc1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/kilo)

Reviewed: https://review.openstack.org/223968
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2e731ebc9dd4890b6bfa57ceaaa6dadba2e4b1c2
Submitter: Jenkins
Branch: stable/kilo

commit 2e731ebc9dd4890b6bfa57ceaaa6dadba2e4b1c2
Author: Rajesh Tailor <email address hidden>
Date: Thu Sep 10 23:15:46 2015 -0700

    Remove unnecessary 'context' param from quotas reserve method call

    'context' parameter was removed from quota-related method signatures in patch [1].
    In patch [2] use of 'context' parameter was removed from quota-related method calls.

    Still at some places 'context' parameter was passed to quota reserve method call.

    Removed use of 'context' parameter from those places and passed 'context' as kwargs
    while creating object of nova.objects.Quotas type.

    [1] https://review.openstack.org/#/c/164268/
    [2] https://review.openstack.org/#/c/160499/

    Backport notice:
    On restart of nova-compute if there is instance with vm_state as
    'DELETED' but that instance is not marked as deleted in database. In that case,
    while calling _complete_partial_deletion method from _init_instance method
    it raises " ValueError: Circular reference detected" error.

    Removing 'context' parameter from quotas.reserve method call in
    _complete_partial_deletion method addresses this issue as well.

    Change-Id: I20ea77bd20f093ce1be7169c0647cdc7ff62117c
    Closes-Bug: 1494653
    (cherry picked from commit 4031272fe93d1046cff4c0cc788c8e78db944419)

tags: added: in-stable-kilo
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-rc1 → 12.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.