Printing a list of networks terminates with exception

Bug #1093637 reported by Gary Kotton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Gary Kotton
Folsom
Fix Released
High
Gary Kotton

Bug Description

Hi,
I did the following:
1. Created 500 networks
2. Deleted 500 networks

Between 1 and 2 I did quantum net-list. The result was an exception:
openstack@ubuntu-devstack:~/devstack$ quantum net-list
'NoneType' object has no attribute 'network_type'
openstack@ubuntu-devstack:~/devstack$

More specifically:
2012-12-24 11:57:00 10346 INFO quantum.openstack.common.rpc.common [-] Connected to AMQP server on localhost:5672
2012-12-24 11:57:02 10346 ERROR quantum.api.v2.resource [-] index failed
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource Traceback (most recent call last):
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource File "/opt/stack/quantum/quantum/api/v2/resource.py", line 96, in resource
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource result = method(request=request, **args)
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource File "/opt/stack/quantum/quantum/api/v2/base.py", line 225, in index
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource return self._items(request, True, parent_id)
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource File "/opt/stack/quantum/quantum/api/v2/base.py", line 191, in _items
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource obj_list = obj_getter(request.context, **kwargs)
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource File "/opt/stack/quantum/quantum/plugins/openvswitch/ovs_quantum_plugin.py", line 480, in get_networks
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource self._extend_network_dict_provider(context, net)
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource File "/opt/stack/quantum/quantum/plugins/openvswitch/ovs_quantum_plugin.py", line 293, in _extend_network_dict_provider
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource network[provider.NETWORK_TYPE] = binding.network_type
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource AttributeError: 'NoneType' object has no attribute 'network_type'
2012-12-24 11:57:02 10346 TRACE quantum.api.v2.resource

The problem is that the operation on the database is not atomic.
Thanks
Gary

Gary Kotton (garyk)
tags: added: folsom-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Changed in quantum:
assignee: nobody → Gary Kotton (garyk)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/18646
Committed: http://github.com/openstack/quantum/commit/19d65cdfd526d7ed5325f40f8dad31b1a04b4c47
Submitter: Jenkins
Branch: master

commit 19d65cdfd526d7ed5325f40f8dad31b1a04b4c47
Author: Gary Kotton <email address hidden>
Date: Tue Dec 25 15:11:35 2012 +0000

    Provide "atomic" database access for networks

    Fixes bug 1093637

    In the OVS and LB plugins there are cases when accessing the network
    has an additional database query. The patch enables this to occur
    without accessing an invalid database entry.

    Change-Id: I7d4944cf3240819f23dd7b4993d6ae3cefab9dc2

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

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/18651

Gary Kotton (garyk)
Changed in quantum:
milestone: none → grizzly-2
importance: Undecided → High
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (stable/folsom)

Reviewed: https://review.openstack.org/18651
Committed: http://github.com/openstack/quantum/commit/5f8dd88f17caa47bc7c25479839f3a75b77db47a
Submitter: Jenkins
Branch: stable/folsom

commit 5f8dd88f17caa47bc7c25479839f3a75b77db47a
Author: Gary Kotton <email address hidden>
Date: Tue Dec 25 15:11:35 2012 +0000

    Provide "atomic" database access for networks

    Fixes bug 1093637

    In the OVS and LB plugins there are cases when accessing the network
    has an additional database query. The patch enables this to occur
    without accessing an invalid database entry.

    Change-Id: I7d4944cf3240819f23dd7b4993d6ae3cefab9dc2

tags: added: in-stable-folsom
Mark McLoughlin (markmc)
tags: removed: folsom-backport-potential in-stable-folsom
Thierry Carrez (ttx)
Changed in quantum:
milestone: grizzly-2 → 2013.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.