summaryrefslogtreecommitdiff
path: root/trove/cmd
diff options
context:
space:
mode:
authorCorey Bryant <corey.bryant@canonical.com>2020-05-05 15:42:31 -0400
committerLingxian Kong <anlin.kong@gmail.com>2020-07-18 10:09:51 +0000
commit56bb6f39b6c808160d2e4c96fcc2104ba1daf817 (patch)
treec3d5bdf3fbda1ffd5b2013288d4bd34822dff1ac /trove/cmd
parent828e873846495df6d6911f9c196ae1fb478492f5 (diff)
downloadtrove-56bb6f39b6c808160d2e4c96fcc2104ba1daf817.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: I61e5e270bf66b0355da3282c19cbc9fd42c4090b Closes-Bug: #1863021
Diffstat (limited to 'trove/cmd')
-rw-r--r--trove/cmd/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/trove/cmd/__init__.py b/trove/cmd/__init__.py
index c579ba3b..bdb9af1a 100644
--- a/trove/cmd/__init__.py
+++ b/trove/cmd/__init__.py
@@ -26,3 +26,9 @@ import os
if not os.environ.get('NO_EVENTLET_MONKEYPATCH'):
import eventlet
eventlet.monkey_patch(all=True)
+ # 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 # noqa
+ import threading # noqa
+ orig_threading.current_thread.__globals__['_active'] = threading._active