From 301c173fe09da0dd40aaf355a314b77595fb9a7c Mon Sep 17 00:00:00 2001 From: Andy Shultz Date: Mon, 12 Dec 2022 14:31:03 -0500 Subject: [PATCH] fix: make devstack-with-worker behave like actual worker envs We run atomic-requests in almost all environments (for the lms and cms anyway) EXCEPT devstack_with_worker. Using a different setting means that even if you think you are testing with a worker like real deploys use, you are not actually testing with the data a worker would actually see. The removed code also claims that if you run with atomic transactions and a worker you will deadlock the system. If so edx.org would be deadlocked at all times and yet is not. The old code was vintage 2015 and its assumptions probably haven't been examined since then. --- cms/envs/devstack_with_worker.py | 5 ----- lms/envs/devstack_with_worker.py | 4 ---- 2 files changed, 9 deletions(-) diff --git a/cms/envs/devstack_with_worker.py b/cms/envs/devstack_with_worker.py index 959cd4f436..7b2819fe9d 100644 --- a/cms/envs/devstack_with_worker.py +++ b/cms/envs/devstack_with_worker.py @@ -20,8 +20,3 @@ from cms.envs.devstack import * CELERY_ALWAYS_EAGER = False CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION = True BROKER_URL = 'redis://:password@edx.devstack.redis:6379/' - -# Disable transaction management because we are using a worker. Views -# that request a task and wait for the result will deadlock otherwise. -for database_name in DATABASES: - DATABASES[database_name]['ATOMIC_REQUESTS'] = False diff --git a/lms/envs/devstack_with_worker.py b/lms/envs/devstack_with_worker.py index 84d076445c..449c7f5c72 100644 --- a/lms/envs/devstack_with_worker.py +++ b/lms/envs/devstack_with_worker.py @@ -21,7 +21,3 @@ from lms.envs.devstack import * CELERY_ALWAYS_EAGER = False CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION = True BROKER_URL = 'redis://:password@edx.devstack.redis:6379/' -# Disable transaction management because we are using a worker. Views -# that request a task and wait for the result will deadlock otherwise. -for database_name in DATABASES: - DATABASES[database_name]['ATOMIC_REQUESTS'] = False