Invalid call to linux_net.delete_net_dev on Windows

Bug #1798051 reported by Jan Gutter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-vif
Fix Released
Undecided
Jan Gutter

Bug Description

Some random failures in the gate have started popping up:

vif_plug_ovs.tests.unit.test_plugin.PluginTest.test_unplug_ovs
--------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "vif_plug_ovs/tests/unit/test_plugin.py", line 257, in test_unplug_ovs
        plugin.unplug(self.vif_ovs, self.instance)
      File "vif_plug_ovs/ovs.py", line 282, in unplug
        self._unplug_vif_windows(vif, instance_info)
      File "vif_plug_ovs/ovs.py", line 256, in _unplug_vif_windows
        self.ovsdb.delete_ovs_vif_port(vif.network.bridge, vif.id)
      File "vif_plug_ovs/ovsdb/ovsdb_lib.py", line 90, in delete_ovs_vif_port
        linux_net.delete_net_dev(dev)
      File "vif_plug_ovs/linux_net.py", line 71, in delete_net_dev
        if ip_lib.exists(dev):
      File "os_vif/internal/command/ip/__init__.py", line 39, in exists
        return api._get_impl().exists(device)
      File "os_vif/internal/command/ip/linux/impl_pyroute2.py", line 99, in exists
        idx = ip.link_lookup(ifname=device)
      File "/root/git/openstack/os-vif/.tox/py27/lib/python2.7/site-packages/pyroute2/iproute/linux.py", line 382, in link_lookup
        [i for i in self.get_links() if 'attrs' in i] if
      File "/root/git/openstack/os-vif/.tox/py27/lib/python2.7/site-packages/pyroute2/iproute/linux.py", line 237, in get_links
        result.extend(self.link(cmd, **kwarg))
      File "/root/git/openstack/os-vif/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1062, in __call__
        return _mock_self._mock_call(*args, **kwargs)
      File "/root/git/openstack/os-vif/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1118, in _mock_call
        raise effect
    pyroute2.netlink.exceptions.NetlinkError: (40, 'Error message')

This is likely because I9ec36be390d713a928a673191008612f3fddad8f only partially checks for the correct platform before calling linux specific utilities.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-vif (master)

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

Changed in os-vif:
assignee: nobody → Jan Gutter (jangutter)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
Jan Gutter (jangutter) wrote :

Executive summary:

This failure in the gate exposed two bugs:
* one in the tests (addressed by: https://review.openstack.org/#/c/611017/ )
* one in the windows ovs unplug codepath (addressed by: https://review.openstack.org/#/c/610916/ )

I'm pretty sure of the fix for the tests, but just took a blind stab at the windows codepath.

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

Reviewed: https://review.openstack.org/611017
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=330051a702453ee2953eb43555fa87117751465a
Submitter: Zuul
Branch: master

commit 330051a702453ee2953eb43555fa87117751465a
Author: Jan Gutter <email address hidden>
Date: Tue Oct 16 17:26:04 2018 +0200

    Fix random test_unplug_ovs failures

    https://review.openstack.org/#/c/476612/ introduced an abstract
    OVSDB API, but it seems the gate is randomly calling linux_net utils in
    the context of Windows plug and unplug.

    This was because one of the tests set sys.platform to Windows, resulting
    in random failures, depending on the order in which the tests ran.

    Change-Id: I7e2a548fa4edc743d913f71dde48f613a7a5a8df
    Partial-Bug: #1798051
    Signed-off-by: Jan Gutter <email address hidden>

Changed in os-vif:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/610916
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=c5fda08d4010f91487d1336852ec94b275fdbd8d
Submitter: Zuul
Branch: master

commit c5fda08d4010f91487d1336852ec94b275fdbd8d
Author: Jan Gutter <email address hidden>
Date: Tue Oct 16 17:27:00 2018 +0200

    Do not call linux_net.delete_net_dev on Windows

    The current ovs unplug codepath for Windows triggers an OVSDB port
    delete command, which is applicable, and a linux netdev delete command,
    which is not. This changes the unplug logic to skip the delete step.

    Change-Id: Id7f81ae174d354e593d919813bdf7b3b97cbcd8b
    Closes-Bug: #1798051
    Signed-off-by: Jan Gutter <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-vif 1.12.0

This issue was fixed in the openstack/os-vif 1.12.0 release.

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.