diff --git a/barbican/cmd/keystone_listener.py b/barbican/cmd/keystone_listener.py index 3b49b085d..6e9a9c3c2 100644 --- a/barbican/cmd/keystone_listener.py +++ b/barbican/cmd/keystone_listener.py @@ -27,6 +27,12 @@ import sys # To have remote debugging, thread module needs to be disabled. # eventlet.monkey_patch(thread=False) 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: diff --git a/barbican/cmd/retry_scheduler.py b/barbican/cmd/retry_scheduler.py index fecf29eba..9973adacc 100644 --- a/barbican/cmd/retry_scheduler.py +++ b/barbican/cmd/retry_scheduler.py @@ -25,6 +25,12 @@ import sys # Oslo messaging RPC server uses eventlet. 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: # If ../barbican/__init__.py exists, add ../ to Python search path, so that diff --git a/barbican/cmd/worker.py b/barbican/cmd/worker.py index f9f0d0896..f7a711ca8 100644 --- a/barbican/cmd/worker.py +++ b/barbican/cmd/worker.py @@ -25,6 +25,12 @@ import sys # Oslo messaging RPC server uses eventlet. 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: # If ../barbican/__init__.py exists, add ../ to Python search path, so that