summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Bryant <corey.bryant@canonical.com>2020-05-04 13:18:10 -0400
committerCorey Bryant <corey.bryant@canonical.com>2020-05-12 12:51:19 +0000
commit2e6ae73932e288952e52417d11818ed006f82bbc (patch)
tree7aea6ac70ed3a64b6dec89e6a8cdc62319f67050
parentbceca6189581ba6b462c306f00fb1d9538795d6d (diff)
downloadheat-2e6ae73932e288952e52417d11818ed006f82bbc.tar.gz
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: I0540923755ac3969b584eeba2e19c037a7f2c261 Story: 2007614 (cherry picked from commit 8fd17214a97322a8a0136e50ced1d65a7d9dd75e)
-rw-r--r--heat/cmd/all.py6
-rw-r--r--heat/cmd/api.py6
-rw-r--r--heat/cmd/api_cfn.py6
-rw-r--r--heat/cmd/engine.py6
4 files changed, 24 insertions, 0 deletions
diff --git a/heat/cmd/all.py b/heat/cmd/all.py
index 526bc7fa2..d9c7dd0d6 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 b8ea0111c..4ab22b0d6 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 bc7cd5b02..2a44605e5 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 f30081d7e..b969a4c22 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