[Bug 1863021] Re: eventlet monkey patch results in assert len(_active) == 1 AssertionError

Launchpad Bug Tracker 1863021 at bugs.launchpad.net
Mon Mar 30 23:52:22 UTC 2020


This bug was fixed in the package glance - 2:20.0.0~b3~git2020032414
.30ece7aa-0ubuntu2

---------------
glance (2:20.0.0~b3~git2020032414.30ece7aa-0ubuntu2) focal; urgency=medium

  * d/tests/test-shebang.py: Dropped. No longer used.
  * d/p/monkey-patch-original-current-thread-active.patch: Cherry-picked from
    https://review.opendev.org/#/c/716058/. This fixes glance service failures
    that autopkgtests are hitting with Python 3.8 (LP: #1863021).

 -- Corey Bryant <corey.bryant at canonical.com>  Mon, 30 Mar 2020 14:41:49
-0400

** Changed in: glance (Ubuntu)
       Status: Triaged => Fix Released

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

Title:
  eventlet monkey patch results in assert len(_active) == 1
  AssertionError

Status in Glance:
  In Progress
Status in OpenStack Compute (nova):
  Fix Released
Status in glance package in Ubuntu:
  Fix Released
Status in nova package in Ubuntu:
  Fix Released

Bug description:
  This appears to be the same issue documented here:
  https://github.com/eventlet/eventlet/issues/592

  However I seem to only hit this with python3.8. Basically nova and
  glance services fail with:

   Exception ignored in: <function _after_fork at 0x7f1100d075e0>
   Traceback (most recent call last):
     File "/usr/lib/python3.8/threading.py", line 1454, in _after_fork
       assert len(_active) == 1
   AssertionError:
   Exception ignored in: <function _after_fork at 0x7f1100d075e0>
   Traceback (most recent call last):
     File "/usr/lib/python3.8/threading.py", line 1454, in _after_fork
       assert len(_active) == 1
   AssertionError:

  Patching nova/monkey_patch.py with the following appears to fix this:

  diff --git a/nova/monkey_patch.py b/nova/monkey_patch.py
  index a07ff91dac..bb7252c643 100644
  --- a/nova/monkey_patch.py
  +++ b/nova/monkey_patch.py
  @@ -59,6 +59,9 @@ def _monkey_patch():
       else:
           eventlet.monkey_patch()

  +    import __original_module_threading
  +    import threading
  +    __original_module_threading.current_thread.__globals__['_active'] = threading._active
       # NOTE(rpodolyaka): import oslo_service first, so that it makes eventlet
       # hub use a monotonic clock to avoid issues with drifts of system time (see

  Similar patches to glance/cmd/api.py, glance/cmd/scrubber.py and
  glance/cmd/registry.py appears to fix it for glance.

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



More information about the Ubuntu-openstack-bugs mailing list