diff --git a/awx/main/dispatch/worker/task.py b/awx/main/dispatch/worker/task.py index c9375804c2..eda332c146 100644 --- a/awx/main/dispatch/worker/task.py +++ b/awx/main/dispatch/worker/task.py @@ -5,7 +5,6 @@ import time from django_guid import set_guid - logger = logging.getLogger('awx.main.dispatch') diff --git a/awx/main/management/commands/run_dispatcher.py b/awx/main/management/commands/run_dispatcher.py index dc7dcd4c8d..e5cdd703f4 100644 --- a/awx/main/management/commands/run_dispatcher.py +++ b/awx/main/management/commands/run_dispatcher.py @@ -62,5 +62,12 @@ class Command(BaseCommand): print(yaml.dump(results, default_flow_style=False)) return + self.configure_dispatcher_logging() + # Close the connection, because the pg_notify broker will create new async connection + connection.close() + django_cache.close() + dispatcher_setup(get_dispatcherd_config(for_service=True)) + run_service() + dispatcher_setup(get_dispatcherd_config(for_service=True)) run_service() diff --git a/awx/main/tests/settings_for_test.py b/awx/main/tests/settings_for_test.py index b7d5cdf023..5634494c33 100644 --- a/awx/main/tests/settings_for_test.py +++ b/awx/main/tests/settings_for_test.py @@ -7,9 +7,6 @@ from awx.settings.development import * # NOQA # Some things make decisions based on settings.SETTINGS_MODULE, so this is done for that SETTINGS_MODULE = 'awx.settings.development' -# Turn off task submission, because sqlite3 does not have pg_notify -DISPATCHER_MOCK_PUBLISH = True - # Use SQLite for unit tests instead of PostgreSQL. If the lines below are # commented out, Django will create the test_awx-dev database in PostgreSQL to # run unit tests. diff --git a/awx/main/tests/unit/test_settings.py b/awx/main/tests/unit/test_settings.py index 5103d0759e..ee517d6a87 100644 --- a/awx/main/tests/unit/test_settings.py +++ b/awx/main/tests/unit/test_settings.py @@ -8,7 +8,6 @@ LOCAL_SETTINGS = ( 'CACHES', 'DEBUG', 'NAMED_URL_GRAPH', - 'DISPATCHER_MOCK_PUBLISH', # Platform flags are managed by the platform flags system and have environment-specific defaults 'FEATURE_INDIRECT_NODE_COUNTING_ENABLED', ) diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 04490866f7..981e3d80b6 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -416,11 +416,6 @@ EXECUTION_NODE_REMEDIATION_CHECKS = 60 * 30 # once every 30 minutes check if an # Amount of time dispatcher will try to reconnect to database for jobs and consuming new work DISPATCHER_DB_DOWNTIME_TOLERANCE = 40 -# If you set this, nothing will ever be sent to pg_notify -# this is not practical to use, although periodic schedules may still run slugish but functional tasks -# sqlite3 based tests will use this -DISPATCHER_MOCK_PUBLISH = False - 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