diff --git a/heat/cmd/all.py b/heat/cmd/all.py index 526bc7fa29..d9c7dd0d68 100644 --- a/heat/cmd/all.py +++ b/heat/cmd/all.py @@ -20,6 +20,12 @@ An OpenStack Heat server that can run all services. import eventlet eventlet.monkey_patch(os=False) +# 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/heat/cmd/api.py b/heat/cmd/api.py index b8ea0111cf..4ab22b0d66 100644 --- a/heat/cmd/api.py +++ b/heat/cmd/api.py @@ -20,6 +20,12 @@ An OpenStack ReST API to Heat. import eventlet eventlet.monkey_patch(os=False) +# 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/heat/cmd/api_cfn.py b/heat/cmd/api_cfn.py index bc7cd5b022..2a44605e5c 100644 --- a/heat/cmd/api_cfn.py +++ b/heat/cmd/api_cfn.py @@ -22,6 +22,12 @@ AMQP RPC to implement them. import eventlet eventlet.monkey_patch(os=False) +# 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/heat/cmd/engine.py b/heat/cmd/engine.py index f30081d7e7..b969a4c22b 100644 --- a/heat/cmd/engine.py +++ b/heat/cmd/engine.py @@ -22,6 +22,12 @@ engine. 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