Race between list_networks and delete_network in OVS plugin

Bug #1263686 reported by Eugene Nikanorov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Eugene Nikanorov

Bug Description

When listing networks, OVS plugin fetches networks bindings via additional per-network db-query.

In case some network (and its binding) from the list is getting deleted in the process of extending networks dict, _extend_network_dict_provider throws an exception:

TRACE neutron.api.v2.resource Traceback (most recent call last):
TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 84, in resource
TRACE neutron.api.v2.resource result = method(request=request, **args)
TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 279, in index
TRACE neutron.api.v2.resource return self._items(request, True, parent_id)
TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 233, in _items
TRACE neutron.api.v2.resource obj_list = obj_getter(request.context, **kwargs)
TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/openvswitch/ovs_neutron_plugin.py", line 567, in get_networks
TRACE neutron.api.v2.resource self._extend_network_dict_provider(context, net)
TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/openvswitch/ovs_neutron_plugin.py", line 381, in _extend_network_dict_provider
TRACE neutron.api.v2.resource network[provider.NETWORK_TYPE] = binding.network_type
TRACE neutron.api.v2.resource AttributeError: 'NoneType' object has no attribute 'network_type'

This issue is reproducible easily with tempest.api.network.test_networks.BulkNetworkOps

Tags: db ovs
tags: added: db ovs
Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/63918
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=126a26367b40125b3e434c948f21a4980bc86340
Submitter: Jenkins
Branch: master

commit 126a26367b40125b3e434c948f21a4980bc86340
Author: Eugene Nikanorov <email address hidden>
Date: Tue Dec 24 15:08:22 2013 +0400

    Fix race in get_network(s) in OVS plugin

    Load network bindings eagerly with networks.
    Otherwise a different db query could try to fetch network bindings
    for already deleted networks. The issue is reproducible with
    concurrent tempest network API tests.

    Closes-Bug: 1263686
    Change-Id: I0521ab162220c66a62491ff8e7e4a9f6d7bef6c4

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-2 → 2014.1
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.