← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Reviewed:  https://review.opendev.org/707474
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2078ef850c93b47ec1bcd044450b589d7a8fc0b5
Submitter: Zuul
Branch:    master

commit 2078ef850c93b47ec1bcd044450b589d7a8fc0b5
Author: Corey Bryant <corey.bryant@xxxxxxxxxxxxx>
Date:   Wed Feb 12 16:32:40 2020 -0500

    Monkey patch original current_thread _active
    
    Monkey patch the original current_thread to use the up-to-date _active
    global variable. This solution is based on that documented at:
    https://github.com/eventlet/eventlet/issues/592
    
    Change-Id: I4872169413f27aeaff8d8fdfa5cdaf6ee32f4680
    Closes-Bug: #1863021


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

** Bug watch added: github.com/eventlet/eventlet/issues #592
   https://github.com/eventlet/eventlet/issues/592

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1863021

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

Status in OpenStack Compute (nova):
  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
  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

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


References