When an instructor changes the grade policy, the compute_all_grades_for_course task (task name lms.djangoapps.grades.tasks.compute_all_grades_for_course) is triggered. It is supposed to be executed in the lms-worker, but it is executed in the cms-worker instead, causing it to fail. I discovered this issue while checking /admin/celery_utils/failedtask/.
I tried setting POLICY_CHANGE_GRADES_ROUTING_KEY = “edx.lms.core.default” for both LMS and CMS, but the task still ran in the cms-worker.
Hmm, that’s a good question, I’m not sure. The celery queue setup is fairly convoluted and something that it wolud be nice to cleanup but has been low on the priority list. Some of the recent settings cleanups will help make it easier to understand hopefully.
I also found something similar. When you modify any content in Studio, the task update_course_in_cache_v2 is executed in the LMS worker. I’m using Tutor v19.
I’m curious to know: If an operation is executed in CMS/Studio, then the related task should go to the CMS worker. If update_course_in_cache_v2 is going to the LMS worker instead. What could be the reason?
@Mahendra I think Feanil explained in the post above that task scheduling is design dependent, it is important that the task is executed in the right environment without errors. So it is not wrong for CMS to schedule tasks on lms-worker.