Monkey patch original current_thread _active in processutils

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: I0a2c1e0d8a8cad99d68100d25e88e0d3a2eb8f5c
Related-Bug: #1863021
(cherry picked from commit 6533958f5f)
This commit is contained in:
Rodolfo Alonso Hernandez 2020-09-30 11:27:31 +00:00
parent 27585e453a
commit adde6d913f
1 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,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