Make native threading the default concurrency mode

This change makes native threading the default concurrency mode for all
Watcher services (API, Decision Engine, and Applier), deprecating the
Eventlet mode.

Key changes:
 - Invert the OS_WATCHER_DISABLE_EVENTLET_PATCHING logic so threading
   is enabled by default; users must explicitly set the variable to
   'false' to use Eventlet mode
 - Rename CI jobs and tox environments from *-threading to *-eventlet
   since threading is now the default

Assisted-By: Claude (opus-4-5)
Change-Id: I3c2c7782542bce64f0232f9f79ed07b48fbcfa12
Signed-off-by: Douglas Viroel <viroel@gmail.com>
This commit is contained in:
Douglas Viroel
2026-03-16 16:41:39 -03:00
parent ad7b94d93e
commit 58a2fc9a37
6 changed files with 52 additions and 30 deletions
+15 -15
View File
@@ -330,31 +330,31 @@
CEILOMETER_PIPELINE_INTERVAL: 15
- job:
name: watcher-tempest-prometheus-threading
name: watcher-tempest-prometheus-eventlet
parent: watcher-tempest-prometheus
description: |
Watcher multinode devstack tempest job with Prometheus as datasource and
threading mode enabled in specific services.
vars: &threading_vars
eventlet mode enabled in specific services.
vars: &eventlet_vars
devstack_localrc:
'SYSTEMD_ENV_VARS["watcher-api"]': OS_WATCHER_DISABLE_EVENTLET_PATCHING=true
'SYSTEMD_ENV_VARS["watcher-decision-engine"]': OS_WATCHER_DISABLE_EVENTLET_PATCHING=true
'SYSTEMD_ENV_VARS["watcher-applier"]': OS_WATCHER_DISABLE_EVENTLET_PATCHING=true
'SYSTEMD_ENV_VARS["watcher-api"]': OS_WATCHER_DISABLE_EVENTLET_PATCHING=false
'SYSTEMD_ENV_VARS["watcher-decision-engine"]': OS_WATCHER_DISABLE_EVENTLET_PATCHING=false
'SYSTEMD_ENV_VARS["watcher-applier"]': OS_WATCHER_DISABLE_EVENTLET_PATCHING=false
devstack_local_conf:
post-config:
$WATCHER_CONF:
DEFAULT:
print_thread_pool_stats: true
group-vars:
subnode: *threading_vars
subnode: *eventlet_vars
- job:
name: openstack-tox-py312-threading
parent: openstack-tox-py312
name: openstack-tox-py313-eventlet
parent: openstack-tox-py313
description: |
Run tox with the py3-threading environment.
Run tox with the py3-eventlet environment.
vars:
tox_envlist: py3-threading
tox_envlist: py3-eventlet
- job:
name: watcher-tempest-aetos-realdata
@@ -383,7 +383,7 @@
- release-notes-jobs-python3
check:
jobs:
- openstack-tox-py312-threading
- openstack-tox-py313-eventlet
- watcher-grenade
- watcher-grenade-skip-level-always
- watcher-tempest-api-ipv6-only
@@ -392,11 +392,11 @@
files: &watcherclient_functional_files
- ^watcher/api/*
- watcher-tempest-prometheus
- watcher-tempest-prometheus-threading
- watcher-tempest-prometheus-eventlet
- watcher-tempest-aetos
gate:
jobs:
- openstack-tox-py312-threading
- openstack-tox-py313-eventlet
- watcher-grenade
- watcher-grenade-skip-level-always
- watcher-tempest-api-ipv6-only
@@ -404,7 +404,7 @@
- python-watcherclient-functional:
files: *watcherclient_functional_files
- watcher-tempest-prometheus
- watcher-tempest-prometheus-threading
- watcher-tempest-prometheus-eventlet
- watcher-tempest-aetos
experimental:
jobs:
+9 -7
View File
@@ -55,20 +55,22 @@ types of concurrency used in various services of Watcher.
Concurrency modes
#################
Evenlet has been the main concurrency library within the OpenStack community
Eventlet has been the main concurrency library within the OpenStack community
for the last 10 years since the removal of twisted. Over the last few years,
the maintenance of eventlet has decreased and the efforts to remove the GIL
from Python (PEP 703), have fundamentally changed how concurrency works, making
eventlet no longer viable. While transitioning to a new native thread
solution, Watcher services will be supporting both modes, with the usage of
native threading mode initially classified as ``experimental``.
eventlet no longer viable.
It is possible to enable the new native threading mode by setting the following
environment variable in the corresponding service configuration:
Starting from the 2026.2 release, Watcher services use native threading mode
by default. The eventlet mode is still supported but is now deprecated and
will be removed in a future release.
To re-enable the legacy eventlet mode, set the following environment variable
in the corresponding service configuration:
.. code:: bash
OS_WATCHER_DISABLE_EVENTLET_PATCHING=true
OS_WATCHER_DISABLE_EVENTLET_PATCHING=false
Decision engine concurrency
***************************
@@ -0,0 +1,13 @@
---
upgrade:
- |
All Watcher services (API, Decision Engine, and Applier) now run in
``native threading`` mode by default. Previously, Eventlet was the default
concurrency library. For more information, please check `eventlet removal
<https://wiki.openstack.org/wiki/Eventlet-removal>`__ documentation.
deprecations:
- |
The Eventlet concurrency mode is now deprecated and will be removed in a
future release. To temporarily re-enable Eventlet mode, set the environment
variable ``OS_WATCHER_DISABLE_EVENTLET_PATCHING=false`` in the service
configuration. Users are encouraged to migrate to native threading mode.
+2 -2
View File
@@ -37,9 +37,9 @@ passenv =
# debugging issue with fixtures and mocks.
PYTHONOPTIMIZE
[testenv:py3-threading]
[testenv:py3-eventlet]
setenv =
OS_WATCHER_DISABLE_EVENTLET_PATCHING=true
OS_WATCHER_DISABLE_EVENTLET_PATCHING=false
commands =
rm -f .testrepository/times.dbm
find . -type f -name "*.py[c|o]" -delete
+6 -3
View File
@@ -24,10 +24,13 @@ LOG = log.getLogger(__name__)
def init_oslo_service_backend():
if eventlet_helper.is_patched():
backend.init_backend(backend.BackendType.EVENTLET)
LOG.warning("Service is starting with Eventlet based service backend.")
LOG.warning(
"Service is starting with Eventlet based service backend. "
"Running in eventlet mode is deprecated and it will "
"be removed in future releases."
)
else:
backend.init_backend(backend.BackendType.THREADING)
LOG.warning(
"Service is starting with Threading based service backend. "
"This is an experimental feature, do not use it in production."
"Service is starting with Threading based service backend."
)
+7 -3
View File
@@ -34,9 +34,13 @@ def _monkey_patch():
def _is_patching_enabled():
if os.environ.get(
'OS_WATCHER_DISABLE_EVENTLET_PATCHING', ''
).lower() not in ('1', 'true', 'yes', 'y'):
# NOTE(dviroel): The default is now to always disable eventlet patching
if os.environ.get('OS_WATCHER_DISABLE_EVENTLET_PATCHING', '').lower() in (
'0',
'false',
'no',
'n',
):
return True
return False