diff --git a/manila/cmd/api.py b/manila/cmd/api.py index 42db0501a5..46490e85dd 100644 --- a/manila/cmd/api.py +++ b/manila/cmd/api.py @@ -20,6 +20,12 @@ import 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 import sys diff --git a/manila/cmd/data.py b/manila/cmd/data.py index 3eefafbb4f..fe22b2cf22 100644 --- a/manila/cmd/data.py +++ b/manila/cmd/data.py @@ -18,6 +18,12 @@ import 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 import sys diff --git a/manila/cmd/scheduler.py b/manila/cmd/scheduler.py index 6c0546742a..457e96d194 100644 --- a/manila/cmd/scheduler.py +++ b/manila/cmd/scheduler.py @@ -20,6 +20,12 @@ import 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 import sys diff --git a/manila/cmd/share.py b/manila/cmd/share.py index 5822a2ec54..3b0719b700 100644 --- a/manila/cmd/share.py +++ b/manila/cmd/share.py @@ -19,6 +19,12 @@ import 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 import sys