summaryrefslogtreecommitdiff
path: root/oslo_concurrency/processutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_concurrency/processutils.py')
-rw-r--r--oslo_concurrency/processutils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/oslo_concurrency/processutils.py b/oslo_concurrency/processutils.py
index c078490..fea5ecd 100644
--- a/oslo_concurrency/processutils.py
+++ b/oslo_concurrency/processutils.py
@@ -55,6 +55,13 @@ if eventlet_patched:
from eventlet.green import subprocess
from eventlet import tpool
+
+ # 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
+ orig_threading.current_thread.__globals__['_active'] = threading._active
else:
import subprocess