l3 prevent port deletion doesn't handle missing ports

Bug #1416554 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Kevin Benton
Juno
Fix Released
Low
Kevin Benton

Bug Description

The l3 code to check to see if a port can be deleted does not handle the case where the port id it is passed does not refer to a port that still exists. This throws an exception and makes the API behavior inconsistent when two concurrent requests come in to delete the same port.[1] This is inconsistent because if the port is concurrently deleted after the l3 check is done but before the delete attempt is made, no exception will be raised.[2]

1. This happens frequently when horizon deletes the subnet and immediately deletes the network afterwards. The dhcp agent will delete it's port on the subnet cleanup and may rip the port right before the delete_network call does it's auto port cleanup. The auto port cleanup will then hit a portnotfound exception which goes uncaught.
2. https://github.com/openstack/neutron/blob/6a797f354eb4ba936b80603f7cc01a2fe80446fd/neutron/plugins/ml2/plugin.py#L1113

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/151788

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
status: New → In Progress
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 4f5b01c18b66e9f456150ceed08e8f0264499d7e
Author: Kevin Benton <email address hidden>
Date: Fri Jan 30 12:53:57 2015 -0800

    Make prevent_l3_port_deletion handle missing port

    This adjusts the prevent_l3_port_deletion function to handle
    the case where the port ID that is passed to it does not have
    an entry in the database.

    Previously it was raising an exception in this case, which is
    inconsistent to how ML2 was handling concurrent port_delete requests
    further in the port delete function (log them but don't fail).

    Closes-Bug: #1416554
    Change-Id: I6da021bdf0c79f72336416d02ab989407f352904

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

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/152425

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

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/152426

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

Reviewed: https://review.openstack.org/152425
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=6e9c7603acff912c9a9531648c6b845ff844183a
Submitter: Jenkins
Branch: stable/juno

commit 6e9c7603acff912c9a9531648c6b845ff844183a
Author: Kevin Benton <email address hidden>
Date: Fri Jan 30 12:53:57 2015 -0800

    Make prevent_l3_port_deletion handle missing port

    This adjusts the prevent_l3_port_deletion function to handle
    the case where the port ID that is passed to it does not have
    an entry in the database.

    Previously it was raising an exception in this case, which is
    inconsistent to how ML2 was handling concurrent port_delete requests
    further in the port delete function (log them but don't fail).

    Conflicts:
     neutron/plugins/ml2/plugin.py
     neutron/tests/unit/test_l3_plugin.py

    Closes-Bug: #1416554
    Change-Id: I6da021bdf0c79f72336416d02ab989407f352904
    (cherry picked from commit 4f5b01c18b66e9f456150ceed08e8f0264499d7e)

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

Change abandoned by Kevin Benton (<email address hidden>) on branch: stable/icehouse
Review: https://review.openstack.org/152426
Reason: not buggy enough for icehouse

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