deprecate eventlet monkey patching within oslo.privsep.daemon

Change-Id: I26ed6b42fc6eeeef23ad37e74631f372de6daf2c
This commit is contained in:
Hervé Beraud 2025-01-29 13:23:48 +01:00 committed by Takashi Kajinami
parent 024c7ec3c0
commit 7e7e247bdd
3 changed files with 20 additions and 0 deletions

View File

@ -55,6 +55,7 @@ import sys
import tempfile
import threading
import debtcollector
import eventlet
from eventlet import patcher
from oslo_config import cfg
@ -83,7 +84,10 @@ def _null():
return []
_MONKEY_PATCHED = False
for module in EVENTLET_MODULES:
if eventlet.patcher.is_monkey_patched(module):
_MONKEY_PATCHED = True
if hasattr(patcher, '_green_%s_modules' % module):
method = getattr(patcher, '_green_%s_modules' % module)
elif hasattr(patcher, '_green_%s' % module):
@ -92,6 +96,10 @@ for module in EVENTLET_MODULES:
method = _null()
EVENTLET_LIBRARIES.append((module, method))
if _MONKEY_PATCHED:
debtcollector.deprecate(
"Eventlet support is deprecated and will be removed")
@enum.unique
class StdioFd(enum.IntEnum):

View File

@ -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 the ``daemon`` module of oslo.privsep in a monkey
patched environment is now deprecated. The support of Eventlet will be
soon removed from oslo.privsep.
Please start considering removing your internal Eventlet usages and
start migrating your stack.

View File

@ -10,3 +10,4 @@ cffi>=1.14.0 # MIT
eventlet>=0.21.0 # MIT
greenlet>=0.4.14 # MIT
msgpack>=0.6.0 # Apache-2.0
debtcollector>=3.0.0 # Apache-2.0