Merge "deprecate eventlet monkey patch within oslo.log"

This commit is contained in:
Zuul authored and Gerrit Code Review committed 2025-02-06 18:22:51 +00:00
commit b1067e44a9
3 files changed
+25 -8

No files matched your search

+13 -8
View File
@@ -38,6 +38,7 @@ try:
except ImportError:
syslog = None
import debtcollector
from oslo_config import cfg
from oslo_utils import eventletutils
from oslo_utils import importutils
@@ -275,14 +276,18 @@ def _fix_eventlet_logging():
global _EVENTLET_FIX_APPLIED
# If eventlet was not loaded before call to setup assume it's not used.
if eventletutils.is_monkey_patched('thread') and not _EVENTLET_FIX_APPLIED:
import eventlet.green.threading
from oslo_log import pipe_mutex
logging.threading = eventlet.green.threading
logging._lock = logging.threading.RLock()
logging.Handler.createLock = pipe_mutex.pipe_createLock
_EVENTLET_FIX_APPLIED = True
if eventletutils.is_monkey_patched('thread'):
debtcollector.deprecate(
"Eventlet support is deprecated and will be removed")
# If eventlet was not loaded before call to setup assume it's not used.
if not _EVENTLET_FIX_APPLIED:
import eventlet.green.threading
from oslo_log import pipe_mutex
logging.threading = eventlet.green.threading
logging._lock = logging.threading.RLock()
logging.Handler.createLock = pipe_mutex.pipe_createLock
_EVENTLET_FIX_APPLIED = True
def setup(conf, product_name, version='unknown', *, fix_eventlet=True):
@@ -0,0 +1,11 @@
---
deprecations:
- |
Eventlet usages are deprecated and the removal of Eventlet from
OpenStack `is planned <https://governance.openstack.org/tc//goals/proposed/remove-eventlet.html>`_,
for this reason, using oslo.log in a monkey
patched environment is now deprecated. The support of Eventlet will be
soon removed from oslo.log.
Please start considering removing your internal Eventlet usages and
start migrating your stack.
+1
View File
@@ -9,3 +9,4 @@ oslo.i18n>=3.20.0 # Apache-2.0
oslo.utils>=3.36.0 # Apache-2.0
oslo.serialization>=2.25.0 # Apache-2.0
python-dateutil>=2.7.0 # BSD
debtcollector>=3.0.0 # Apache-2.0