Skip to content

Commit

Permalink
Monkey patch original current_thread _active in processutils
Browse files Browse the repository at this point in the history
Monkey patch the original current_thread to use the up-to-date _active
global variable. This solution is based on that documented at:
eventlet/eventlet#592

Change-Id: I0a2c1e0d8a8cad99d68100d25e88e0d3a2eb8f5c
Related-Bug: #1863021
(cherry picked from commit 6533958)
  • Loading branch information
ralonsoh committed Oct 9, 2020
1 parent a2b5fae commit f4d2dd8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions oslo_concurrency/processutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
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

Expand Down

0 comments on commit f4d2dd8

Please sign in to comment.