← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1856853] Re: OVSInterfaceDriver.plug_new should catch pyroute2.netlink.exceptions.NetlinkError

 

Reviewed:  https://review.opendev.org/699700
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e54b64f7258b95940369c21c0027947971aaa1f9
Submitter: Zuul
Branch:    master

commit e54b64f7258b95940369c21c0027947971aaa1f9
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date:   Wed Dec 18 15:10:23 2019 +0000

    OVSInterfaceDriver.plug_new should catch correct exceptions
    
    Now that "IPWrapper.add_device_to_namespace" is implemented with
    Pyroute2, the function should catch the correct exceptions:
    - NetlinkError in case of duplicated interface
    - OSError in case of corrupted namespace
    
    Change-Id: I12b5710dc3bfdcc4c6b1e96bbfbfab9e59684065
    Closes-Bug: #1856853


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1856853

Title:
  OVSInterfaceDriver.plug_new should catch
  pyroute2.netlink.exceptions.NetlinkError

Status in neutron:
  Fix Released

Bug description:
  When "OVSInterfaceDriver.plug_new" is executed, if OVS is not using
  veth pairs and the interface created is in a namespace, the method
  should catch a different exception [1] now that the implementation of
  "add_device_to_namespace" is done with Pyroute2.

  In case of having a duplicated interface in the requested namespace when adding the interface, the exception raised is:
    pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')

  
  How to reproduce manually this issue and see the exception:
  $ ip netns add ns01
  $ python
  >>> from neutron.agent.linux import ip_lib
  >>> i=ip_lib.IPWrapper('ns01')
  >>> _, int1 = i.add_veth('tap1', 'tap0', 'ns02')
  >>> _, int2 = i.add_veth('tap2', 'tap0', 'ns03')
  >>> ip = ip_lib.IPWrapper()
  >>> ns = ip.ensure_namespace('ns01')
  >>> ns.add_device_to_namespace(int1)
  >>> ns.add_device_to_namespace(int2)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/opt/stack/neutron/neutron/agent/linux/ip_lib.py", line 263, in add_device_to_namespace
      device.link.set_netns(self.namespace)
    File "/opt/stack/neutron/neutron/agent/linux/ip_lib.py", line 456, in set_netns
      self.name, self._parent.namespace, net_ns_fd=namespace)
    File "/opt/stack/neutron/neutron/privileged/agent/linux/ip_lib.py", line 67, in sync_inner
      return input_func(*args, **kwargs)
    File "/usr/local/lib/python3.7/dist-packages/oslo_privsep/priv_context.py", line 245, in _wrap
      return self.channel.remote_call(name, args, kwargs)
    File "/usr/local/lib/python3.7/dist-packages/oslo_privsep/daemon.py", line 204, in remote_call
      raise exc_type(*result[2])
  pyroute2.netlink.exceptions.NetlinkError: (22, 'Invalid argument')

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1856853/+subscriptions


References