From dcc891427ab9785b29aa5f9cf9d6d5d9e9af1e40 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 27 Sep 2024 23:45:01 +0900 Subject: [PATCH] Remove workaround for eventlet bug #592 This code worked around a bug in eventlet[1] that has been fixed in 6533958f5fcec8b1577f56834ea2dc75a4f211e3. The fix has been available in every eventlet release since v0.27.0. [1] https://github.com/eventlet/eventlet/issues/592 Co-Authored-By: Cyril Roelandt Change-Id: I377f664b4e5092ee0e2a95a7e277f1c8a1e18953 --- oslo_concurrency/processutils.py | 7 ------- oslo_concurrency/tests/__init__.py | 6 ------ setup.cfg | 4 ++++ test-requirements.txt | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/oslo_concurrency/processutils.py b/oslo_concurrency/processutils.py index 2fad1db..99f48d1 100644 --- a/oslo_concurrency/processutils.py +++ b/oslo_concurrency/processutils.py @@ -61,13 +61,6 @@ 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 diff --git a/oslo_concurrency/tests/__init__.py b/oslo_concurrency/tests/__init__.py index 73122fb..bd455c4 100644 --- a/oslo_concurrency/tests/__init__.py +++ b/oslo_concurrency/tests/__init__.py @@ -17,9 +17,3 @@ import os if os.environ.get('TEST_EVENTLET'): 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 # noqa - import threading # noqa - orig_threading.current_thread.__globals__['_active'] = threading._active diff --git a/setup.cfg b/setup.cfg index 550d8c0..fcf5510 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,3 +31,7 @@ oslo.config.opts = oslo.concurrency = oslo_concurrency.opts:list_opts console_scripts = lockutils-wrapper = oslo_concurrency.lockutils:main + +[extras] +eventlet = + eventlet>=0.27.0 # MIT diff --git a/test-requirements.txt b/test-requirements.txt index 240590e..53c7c51 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,4 +2,4 @@ oslotest>=3.2.0 # Apache-2.0 coverage>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD stestr>=2.0.0 # Apache-2.0 -eventlet>=0.19.0 # MIT +eventlet>=0.27.0 # MIT