ObectDeletedError while deleting network

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

Bug Description

The following trace could be observed running rally tests on multi-server environment:

2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 87, in resource
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 476, in delete
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource obj_deleter(request.context, id, **kwargs)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/plugin.py", line 671, in delete_network
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource self._delete_ports(context, ports)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/plugin.py", line 587, in _delete_ports
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource port.id)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 239, in __get__
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource return self.impl.get(instance_state(instance), dict_)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 589, in get
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource value = callable_(state, passive)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/state.py", line 424, in __call__
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource self.manager.deferred_scalar_loader(self, toload)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/loading.py", line 614, in load_scalar_attributes
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource raise orm_exc.ObjectDeletedError(state)
2015-05-12 11:41:20.503 14172 TRACE neutron.api.v2.resource ObjectDeletedError: Instance '<Port at 0x7fb50067e290>' has been deleted, or its row is otherwise not present.

tags: added: db
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
summary: - ObectDeletedError while removing port
+ ObectDeletedError while deleting network
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit dcc9840684de11835625730aeca10aeaf416929b
Author: Eugene Nikanorov <email address hidden>
Date: Sat May 9 22:56:44 2015 +0400

    Catch ObjectDeletedError and skip port or subnet removal

    When network is deleted service ports are deleted in the scope of
    delete_network. Service ports could also be deleted by other entities
    such as DHCP agent releasing dhcp port.
    That could rarely lead to a race condition when port object used in
    _delete_ports helper is already deleted causing ObjectDeletedError
    exception.
    Need to handle it and prevent object deletion in that case.

    Change-Id: I531251d3211545c82a5bb7a471b7915da9b763b7
    Closes-Bug: #1454408

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

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

Thierry Carrez (ttx)
Changed in neutron:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/kilo)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/kilo)

Reviewed: https://review.openstack.org/207788
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a0632d74bfce2a83f549357b76f70b2d26ea7c18
Submitter: Jenkins
Branch: stable/kilo

commit a0632d74bfce2a83f549357b76f70b2d26ea7c18
Author: Eugene Nikanorov <email address hidden>
Date: Sat May 9 22:56:44 2015 +0400

    Catch ObjectDeletedError and skip port or subnet removal

    When network is deleted service ports are deleted in the scope of
    delete_network. Service ports could also be deleted by other entities
    such as DHCP agent releasing dhcp port.
    That could rarely lead to a race condition when port object used in
    _delete_ports helper is already deleted causing ObjectDeletedError
    exception.
    Need to handle it and prevent object deletion in that case.

    Change-Id: I531251d3211545c82a5bb7a471b7915da9b763b7
    Closes-Bug: #1454408
    (cherry picked from commit dcc9840684de11835625730aeca10aeaf416929b)

tags: added: in-stable-kilo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

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

commit a55e10cfd6369533f0cc22edd6611c9549b8f1b4
Author: Oleg Bondarev <email address hidden>
Date: Wed Aug 12 20:02:01 2015 +0300

    Avoid DB errors when deleting network's ports and subnets

    DB errors may occur when accessing query results
    after the transaction was closed (like ObjectDeletedError).
    Hence it's better to avoid DB object access especially
    when it's not needed.
    This patch changes _delete_ports() and _delete_subnets() to accept
    only ids. Indeed, there is no need to pass db objects to these methods.

    Closes-Bug: #1484135
    Related-Bug: #1454408
    Change-Id: I7507cb1c85defb2e6d5144e5832aea713d6251ae

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (feature/pecan)

Related fix proposed to branch: feature/pecan
Review: https://review.openstack.org/224334

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

Related fix proposed to branch: feature/pecan
Review: https://review.openstack.org/224357

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (feature/pecan)
Download full text (73.6 KiB)

Reviewed: https://review.openstack.org/224357
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fdc3431ccd219accf6a795079d9b67b8656eed8e
Submitter: Jenkins
Branch: feature/pecan

commit fe236bdaadb949661a0bfb9b62ddbe432b4cf5f1
Author: Miguel Angel Ajo <email address hidden>
Date: Thu Sep 3 15:40:12 2015 +0200

    No network devices on network attached qos policies

    Network devices, like internal router legs, or dhcp ports
    should not be affected by bandwidth limiting rules.

    This patch disables application of network attached policies
    to network/neutron owned ports.

    Closes-bug: #1486039
    DocImpact

    Change-Id: I75d80227f1e6c4b3f5fa7762b8dc3b0c0f1abd46

commit db4a06f7caa20a4c7879b58b20e95b223ed8eeaf
Author: Ken'ichi Ohmichi <email address hidden>
Date: Wed Sep 16 10:04:32 2015 +0000

    Use tempest-lib's token_client

    Now tempest-lib provides token_client modules as library and the
    interface is stable. So neutron repogitory doesn't need to contain
    these modules.
    This patch makes neutron use tempest-lib's token_client and removes
    the own modules for the maintenance.

    Change-Id: Ieff7eb003f6e8257d83368dbc80e332aa66a156c

commit 78aed58edbe6eb8a71339c7add491fe9de9a0546
Author: Jakub Libosvar <email address hidden>
Date: Thu Aug 13 09:08:20 2015 +0000

    Fix establishing UDP connection

    Previously, in establish_connection() for UDP protocol data were sent
    but never read on peer socket. That lead to successful read on peer side
    if this connection was filtered. Having constant testing string masked
    this issue as we can't distinguish to which test of connectivity data
    belong.

    This patch makes unique data string per test_connectivity() and
    also makes establish_connection() to create an ASSURED entry in
    conntrack table. Finally, in last test after firewall filter was
    removed, connection is re-established in order to avoid troubles with
    terminated processes or TCP continuing sending packets which weren't
    successfully delivered.

    Closes-Bug: 1478847
    Change-Id: I2920d587d8df8d96dc1c752c28f48ba495f3cf0f

commit e6292fcdd6262434a7b713ad8802db6bc8a6d3dc
Author: YAMAMOTO Takashi <email address hidden>
Date: Wed Sep 16 13:20:51 2015 +0900

    ovsdb: Fix a few docstring

    Change-Id: I53e1e21655b28fe5da60e58aeeb7cbbd103ae014

commit c22949a4449d96a67caa616290cf76b67b182917
Author: fumihiko kakuma <email address hidden>
Date: Wed Sep 16 11:52:59 2015 +0900

    Remove requirements.txt for the ofagent mechanism driver

    It is no longer used.

    Related-Blueprint: core-vendor-decomposition
    https://blueprints.launchpad.net/neutron/+spec/core-vendor-decomposition

    Change-Id: Ib31fb3febf8968e50d86dd66e1e6e1ea2313f8ac

commit d1d4de19d85f961d388c91e70f31b3bafec418c5
Author: Kevin Benton <email address hidden>
Date: Thu Sep 3 20:25:57 2015 -0700

    Always return iterables in L3 get_candidates

    The caller of this function expects iterables.

    Closes-Bug: #1494996
    Change-Id: I3d103e63f4e127a77268502415c0ddb0d804b54a

commit 1ad6ac448067306...

tags: added: in-feature-pecan
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (feature/pecan)

Change abandoned by Doug Wiegley (<email address hidden>) on branch: feature/pecan
Review: https://review.openstack.org/224334

Thierry Carrez (ttx)
Changed in neutron:
milestone: liberty-1 → 7.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.