Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: run Celery tasks asynchronously in dev mode #928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 25, 2023

  1. fix: run Celery tasks asynchronously in dev mode

    In `tutor dev`, Celery tasks were running eagerly (in-process) rather than being delegated to the worker containers for
    asynchronous processing. This difference in behavior between
    `tutor dev` and `tutor local` meant that certain code paths
    and race-condition bugs would not surface when testing in dev.
    
    The cause is that CELERY_ALWAYS_EAGER is set to True in the
    upstream devstack settings file. That's because Devstack does
    not support async LMS/CMS workers; it runs all those tasks
    in-process.
    
    The fix is to simply override CELERY_ALWAYS_EAGER to False.
    We do this in the common settings file for simplicity, but the
    change should not affect production mode, which has always
    had CELERY_ALWAYS_EAGER equal False.
    
    For unit tests, we override CELERY_ALAYS_EAGER back to True,
    because many of them are written to assume in-process tasks.
    kdmccormick committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    099f87a View commit details
    Browse the repository at this point in the history