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: I35335325828c10f7a0a1c97edfd1a842dda77577 Story: 2007614
This commit is contained in:
parent
97ae3bc57a
commit
14e3ab9704
@ -27,6 +27,12 @@ import sys
|
|||||||
# To have remote debugging, thread module needs to be disabled.
|
# To have remote debugging, thread module needs to be disabled.
|
||||||
# eventlet.monkey_patch(thread=False)
|
# eventlet.monkey_patch(thread=False)
|
||||||
eventlet.monkey_patch()
|
eventlet.monkey_patch()
|
||||||
|
# Monkey patch the original current_thread to use the up-to-date _active
|
||||||
|
# global variable. See https://bugs.launchpad.net/bugs/1863021 and
|
||||||
|
# https://github.com/eventlet/eventlet/issues/592
|
||||||
|
import __original_module_threading as orig_threading
|
||||||
|
import threading # noqa
|
||||||
|
orig_threading.current_thread.__globals__['_active'] = threading._active
|
||||||
|
|
||||||
|
|
||||||
# 'Borrowed' from the Glance project:
|
# 'Borrowed' from the Glance project:
|
||||||
|
@ -25,6 +25,12 @@ import sys
|
|||||||
|
|
||||||
# Oslo messaging RPC server uses eventlet.
|
# Oslo messaging RPC server uses eventlet.
|
||||||
eventlet.monkey_patch()
|
eventlet.monkey_patch()
|
||||||
|
# Monkey patch the original current_thread to use the up-to-date _active
|
||||||
|
# global variable. See https://bugs.launchpad.net/bugs/1863021 and
|
||||||
|
# https://github.com/eventlet/eventlet/issues/592
|
||||||
|
import __original_module_threading as orig_threading
|
||||||
|
import threading # noqa
|
||||||
|
orig_threading.current_thread.__globals__['_active'] = threading._active
|
||||||
|
|
||||||
# 'Borrowed' from the Glance project:
|
# 'Borrowed' from the Glance project:
|
||||||
# If ../barbican/__init__.py exists, add ../ to Python search path, so that
|
# If ../barbican/__init__.py exists, add ../ to Python search path, so that
|
||||||
|
@ -25,6 +25,12 @@ import sys
|
|||||||
|
|
||||||
# Oslo messaging RPC server uses eventlet.
|
# Oslo messaging RPC server uses eventlet.
|
||||||
eventlet.monkey_patch()
|
eventlet.monkey_patch()
|
||||||
|
# Monkey patch the original current_thread to use the up-to-date _active
|
||||||
|
# global variable. See https://bugs.launchpad.net/bugs/1863021 and
|
||||||
|
# https://github.com/eventlet/eventlet/issues/592
|
||||||
|
import __original_module_threading as orig_threading
|
||||||
|
import threading # noqa
|
||||||
|
orig_threading.current_thread.__globals__['_active'] = threading._active
|
||||||
|
|
||||||
# 'Borrowed' from the Glance project:
|
# 'Borrowed' from the Glance project:
|
||||||
# If ../barbican/__init__.py exists, add ../ to Python search path, so that
|
# If ../barbican/__init__.py exists, add ../ to Python search path, so that
|
||||||
|
Loading…
Reference in New Issue
Block a user