Some network API methods unnecessarily trigger multiple get_instance_nw_info() calls

Bug #1284345 reported by Hans Lindgren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Hans Lindgren

Bug Description

Network manager methods add_fixed_ip_to_instance() and remove_fixed_ip_from_instance() both return with updated nw_info models. The corresponding network API methods however returns nothing, which has the following effect:

Both API methods have the @refresh_cache decorator that tries to update instance info cache from the decorated method's return value. In absence of a return value, it will make a new rpc call to to get the missing nw_info model. By changing the two API methods so that they return the models that they in fact already get, these extra calls can be avoided altogether.

In addition, having the API methods return updated nw_info models make it possible to further improve as in compute manager, calls to these methods are immediately followed by calls to get updated nw_info.

Tags: network
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/76028

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 75ac0381a41c22c92f7efb602adf6ae22c832be2
Author: Hans Lindgren <email address hidden>
Date: Mon Feb 24 16:20:23 2014 +0100

    Add return value to some network API methods

    Add return value to api methods add_fixed_ip_to_instance() and
    remove_fixed_ip_from_instance(). This allows the @refresh_cache
    decorator to use returned nw_info model for updating instance
    info cache instead of needing to make another rpc call to get
    that same information.

    Tests are added to make sure return values are used by the
    refresh_cache decorator for methods where the rpc call returns
    with the necessary nw_info model.

    Change-Id: I748e4db9de62d82e4dbcb0b9c444b16dabf0ec5d
    Partial-Bug: #1284345

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit bf322d27a0eaec92a9ed6f42c60c2168456825f8
Author: Hans Lindgren <email address hidden>
Date: Mon Feb 24 16:09:17 2014 +0100

    Make compute manager use network api method return values

    Calls to network api methods add_fixed_ip_to_instance() and
    remove_fixed_ip_from_instance() return updated nw_info models
    so there is no need to make separate calls to get this info.

    This change refactors the affected code to avoid such extra
    calls. Related methods in the neutron api are updated to return
    the same information as their nova-network api counterparts.

    Change-Id: I39dcf257ed5c101b13c2243266eed265c64e3c98
    Closes-Bug: #1284345

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
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.