From 054f6032fdc3564ae914215553497284c9e0a10a Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Wed, 10 Dec 2025 14:38:39 -0500 Subject: [PATCH] AAP-47956 Use pg_notify for cancel and debugging, abandon socket approach (#16199) * Use pg_notify for cancel and debugging, abandon socket approach * Bump dispatcherd for pg_notify chunking --- awx/main/dispatch/config.py | 6 ++---- awx/main/management/commands/run_dispatcher.py | 5 ----- awx/settings/defaults.py | 3 --- awx/settings/production_defaults.py | 3 --- requirements/requirements.in | 2 +- requirements/requirements.txt | 4 ++-- 6 files changed, 5 insertions(+), 18 deletions(-) diff --git a/awx/main/dispatch/config.py b/awx/main/dispatch/config.py index 6d99c8e930..9f5773e153 100644 --- a/awx/main/dispatch/config.py +++ b/awx/main/dispatch/config.py @@ -32,10 +32,8 @@ def get_dispatcherd_config(for_service: bool = False, mock_publish: bool = False "process_manager_cls": "ForkServerManager", "process_manager_kwargs": {"preload_modules": ['awx.main.dispatch.hazmat']}, }, - "brokers": { - "socket": {"socket_path": settings.DISPATCHERD_DEBUGGING_SOCKFILE}, - }, - "publish": {"default_control_broker": "socket"}, + "brokers": {}, + "publish": {}, "worker": {"worker_cls": "awx.main.dispatch.worker.dispatcherd.AWXTaskWorker"}, } diff --git a/awx/main/management/commands/run_dispatcher.py b/awx/main/management/commands/run_dispatcher.py index 55f056851c..5211c8ae0f 100644 --- a/awx/main/management/commands/run_dispatcher.py +++ b/awx/main/management/commands/run_dispatcher.py @@ -2,7 +2,6 @@ # All Rights Reserved. import logging import yaml -import os import redis @@ -48,10 +47,6 @@ class Command(BaseCommand): ), ) - def verify_dispatcherd_socket(self): - if not os.path.exists(settings.DISPATCHERD_DEBUGGING_SOCKFILE): - raise CommandError('Dispatcher is not running locally') - def handle(self, *arg, **options): if options.get('status'): if flag_enabled('FEATURE_DISPATCHERD_ENABLED'): diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 48754f7ae6..9d1d97d13e 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -421,9 +421,6 @@ DISPATCHER_DB_DOWNTIME_TOLERANCE = 40 # sqlite3 based tests will use this DISPATCHER_MOCK_PUBLISH = False -# Debugging sockfile for the --status command -DISPATCHERD_DEBUGGING_SOCKFILE = os.path.join(BASE_DIR, 'dispatcherd.sock') - BROKER_URL = 'unix:///var/run/redis/redis.sock' REDIS_RETRY_COUNT = 3 # Number of retries for Redis connection errors REDIS_BACKOFF_CAP = 1.0 # Maximum backoff delay in seconds for Redis retries diff --git a/awx/settings/production_defaults.py b/awx/settings/production_defaults.py index 35bebc1f7b..190779ef28 100644 --- a/awx/settings/production_defaults.py +++ b/awx/settings/production_defaults.py @@ -23,9 +23,6 @@ ALLOWED_HOSTS = [] # only used for deprecated fields and management commands for them BASE_VENV_PATH = os.path.realpath("/var/lib/awx/venv") -# Switch to a writable location for the dispatcher sockfile location -DISPATCHERD_DEBUGGING_SOCKFILE = os.path.realpath('/var/run/tower/dispatcherd.sock') - # Very important that this is editable (not read_only) in the API AWX_ISOLATION_SHOW_PATHS = [ '/etc/pki/ca-trust:/etc/pki/ca-trust:O', diff --git a/requirements/requirements.in b/requirements/requirements.in index f8be8eb7bf..6f17cc0d8e 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -71,7 +71,7 @@ setuptools_scm[toml] setuptools-rust>=0.11.4 # cryptography build dep pkgconfig>=1.5.1 # xmlsec build dep - needed for offline build django-flags>=5.0.13 -dispatcherd # tasking system, previously part of AWX code base +dispatcherd[pg_notify] # tasking system, previously part of AWX code base protobuf>=4.25.8 # CVE-2025-4565 idna>=3.10 # CVE-2024-3651 # Temporarily added to use ansible-runner from git branch, to be removed diff --git a/requirements/requirements.txt b/requirements/requirements.txt index f88df90e25..926001ef2e 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -120,7 +120,7 @@ cython==3.1.3 # via -r /awx_devel/requirements/requirements.in daphne==4.2.1 # via -r /awx_devel/requirements/requirements.in -dispatcherd==2025.5.21 +dispatcherd[pg_notify]==2025.12.10 # via -r /awx_devel/requirements/requirements.in distro==1.9.0 # via -r /awx_devel/requirements/requirements.in @@ -138,7 +138,7 @@ django==5.2.8 # django-solo # djangorestframework # drf-spectacular -# django-ansible-base[feature-flags,jwt-consumer,rbac,resource-registry,rest-filters] @ git+https://github.com/ansible/django-ansible-base@devel # git requirements installed separately +# django-ansible-base @ git+https://github.com/ansible/django-ansible-base@devel # git requirements installed separately # via -r /awx_devel/requirements/requirements_git.txt django-cors-headers==4.9.0 # via -r /awx_devel/requirements/requirements.in