[Bug 1889396] Re: [SRU] ML2 plugin fails with "AttributeError: module 'select' has no attribute 'poll'"

Brian Murray 1889396 at bugs.launchpad.net
Tue Sep 15 18:22:41 UTC 2020


Hello Aurelien, or anyone else affected,

Accepted networking-arista into focal-proposed. The package will build
now and be available at https://launchpad.net/ubuntu/+source/networking-
arista/2019.2.3-0ubuntu1 in a few hours, and then in the -proposed
repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
focal to verification-done-focal. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-focal. In either case, without details of your testing we will
not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: networking-arista (Ubuntu Focal)
       Status: Triaged => Fix Committed

** Tags added: verification-needed verification-needed-focal

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to Ubuntu Cloud Archive.
https://bugs.launchpad.net/bugs/1889396

Title:
  [SRU] ML2 plugin fails with "AttributeError: module 'select' has no
  attribute 'poll'"

Status in Ubuntu Cloud Archive:
  Fix Committed
Status in Ubuntu Cloud Archive stein series:
  Triaged
Status in Ubuntu Cloud Archive train series:
  Triaged
Status in Ubuntu Cloud Archive ussuri series:
  Triaged
Status in networking-arista:
  Fix Released
Status in networking-arista package in Ubuntu:
  Fix Released
Status in networking-arista source package in Focal:
  Fix Committed
Status in networking-arista source package in Groovy:
  Fix Released

Bug description:
  [Impact]
  When running the latest Neutron ML2 Arista plugin on Ubuntu 18.04 with Python 3.6 I get:

  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/networking_arista/ml2/arista_sync.py", line 255, in sync_loop
      sync_required = self.wait_for_sync_required()
    File "/usr/lib/python3/dist-packages/networking_arista/ml2/arista_sync.py", line 184, in wait_for_sync_required
      return self.wait_for_mech_driver_update(timeout)
    File "/usr/lib/python3/dist-packages/networking_arista/ml2/arista_sync.py", line 165, in wait_for_mech_driver_update
      resource = self.provision_queue.get(timeout=timeout)
    File "/usr/lib/python3.6/multiprocessing/queues.py", line 104, in get
      if not self._poll(timeout):
    File "/usr/lib/python3.6/multiprocessing/connection.py", line 257, in poll
      return self._poll(timeout)
    File "/usr/lib/python3.6/multiprocessing/connection.py", line 414, in _poll
      r = wait([self], timeout)
    File "/usr/lib/python3.6/multiprocessing/connection.py", line 903, in wait
      with _WaitSelector() as selector:
    File "/usr/lib/python3.6/selectors.py", line 348, in __init__
      self._poll = select.poll()
  AttributeError: module 'select' has no attribute 'poll'

  This is because arista_sync.py imports eventlet, which removes poll()
  from select as it is considered "non-green", see
  https://github.com/eventlet/eventlet/issues/608 . However earlier in
  mechanism_arista.py multiprocessing was imported, which then adjusted
  its implementation based on the fact that hasattr(select, 'poll') was
  True at that time.

  The first solution that comes to mind would be to import eventlet way
  earlier in the project, before any import to multiprocessing and
  selectors, see http://eventlet.net/doc/patching.html#monkeypatching-
  the-standard-library . But I couldn't find the perfect place for this.

  A cleaner solution (validated locally) is to import
  eventlet.queue.Queue instead of multiprocessing.Queue as we use this
  queue only to synchronise with en eventlet.greenthread. See
  http://eventlet.net/doc/modules/queue.html . So basically:

  --- a/networking_arista/ml2/mechanism_arista.py
  +++ b/networking_arista/ml2/mechanism_arista.py
  [...]
  -from multiprocessing import Queue
  +from eventlet.queue import Queue

  I'll open a review. Thanks!

  PS: I'm hitting this while extending the new OpenStack Neutron API
  Arista Plugin charm ( https://opendev.org/openstack/charm-neutron-api-
  plugin-arista ) in order to support the latest OpenStack releases.

  [Test Case]
  Within the project itself:
  https://opendev.org/x/networking-arista/src/branch/master/networking_arista/tests/unit/ml2/test_arista_sync.py#L31 exercises the newly introduced imports.

  Within a consuming project:
  https://opendev.org/openstack/charm-neutron-api-plugin-arista/src/branch/master/src/tests/tests.yaml#L18 has this code imported by neutron and validates that neutron runs, behaves as expected and succeeds at communicating with an Arista eAPI by creating/deleting networks.

  [Regression Potential]
  A mistake in the touched code could lead to:
  1. neutron-server failing to start if the newly introduced imports don't work.
  2. neutron-server failing to communicate with an Arista eAPI if the monkey-patched multiprocessing.Queue doesn't behave as expected. Note that this problem is already there anyway and this is what we intend to fix here.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1889396/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list