Merge "Move eventlet command scripts to a different dir"

This commit is contained in:
Zuul
2025-07-08 12:41:35 +00:00
committed by Gerrit Code Review
9 changed files with 35 additions and 35 deletions

View File

@@ -39,10 +39,10 @@ oslo.policy.enforcer =
watcher = watcher.common.policy:get_enforcer
console_scripts =
watcher-api = watcher.cmd.api:main
watcher-api = watcher.cmd.eventlet.api:main
watcher-db-manage = watcher.cmd.dbmanage:main
watcher-decision-engine = watcher.cmd.decisionengine:main
watcher-applier = watcher.cmd.applier:main
watcher-decision-engine = watcher.cmd.eventlet.decisionengine:main
watcher-applier = watcher.cmd.eventlet.applier:main
watcher-sync = watcher.cmd.sync:main
watcher-status = watcher.cmd.status:main

View File

@@ -1,29 +0,0 @@
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# NOTE(licanwei): Do eventlet monkey patching here, instead of in
# common/service.py. This allows the API service to run without monkey
# patching under Apache (which uses its own concurrency model). Mixing
# concurrency models can cause undefined behavior and potentially API timeouts.
# NOTE(sean-k-mooney) while ^ is true, since that was written asyncio was added
# to the code base in addition to apscheduler which provides native threads.
# As such we have a lot of technical debt to fix with regards to watchers
# concurrency model as we are mixing up to 3 models the same process.
# apscheduler does not technically support eventlet but it has mostly worked
# until now, apscheduler is used to provide a job schedulers which mixes
# monkey patched and non monkey patched code in the same process.
# That is problematic and can lead to errors on python 3.12+.
# The maas support added asyncio to the codebase which is unsafe to mix
# with eventlets by default.
from watcher import eventlet
eventlet.patch()

View File

@@ -0,0 +1,29 @@
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# NOTE(licanwei): Do eventlet monkey patching here, instead of in
# common/service.py. This allows the API service to run without monkey
# patching under Apache (which uses its own concurrency model). Mixing
# concurrency models can cause undefined behavior and potentially API timeouts.
# NOTE(sean-k-mooney) while ^ is true, since that was written asyncio was added
# to the code base in addition to apscheduler which provides native threads.
# As such we have a lot of technical debt to fix with regards to watchers
# concurrency model as we are mixing up to 3 models the same process.
# apscheduler does not technically support eventlet but it has mostly worked
# until now, apscheduler is used to provide a job schedulers which mixes
# monkey patched and non monkey patched code in the same process.
# That is problematic and can lead to errors on python 3.12+.
# The maas support added asyncio to the codebase which is unsafe to mix
# with eventlets by default.
from watcher import eventlet
eventlet.patch()

View File

@@ -22,7 +22,7 @@ from oslo_service import wsgi
from pecan.testing import load_test_app
from watcher.api import config as api_config
from watcher.cmd import api
from watcher.cmd.eventlet import api
from watcher.common import service
from watcher.tests import base

View File

@@ -21,7 +21,7 @@ from oslo_config import cfg
from oslo_service import service
from watcher.applier import sync
from watcher.cmd import applier
from watcher.cmd.eventlet import applier
from watcher.common import service as watcher_service
from watcher.tests import base

View File

@@ -20,7 +20,7 @@ from unittest import mock
from oslo_config import cfg
from oslo_service import service
from watcher.cmd import decisionengine
from watcher.cmd.eventlet import decisionengine
from watcher.common import service as watcher_service
from watcher.decision_engine.audit import continuous
from watcher.decision_engine import sync