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

Enforce a Celery singleton across cms and lms by using shared module #25840

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

timmc-edx
Copy link
Contributor

@timmc-edx timmc-edx commented Dec 10, 2020

This should prevent the issues we've seen recently where cms modules are
imported by the running lms process, resulting in two celery instances
being created and tasks intermittently being registered to the wrong
instance (and therefore effectively lost.)

In commit ab6bf34/PR #25822 we tried to ensure that only one or the
other of the instances was created by adding a startup check.
Unfortunately, there's an external shared library that refers directly
to the lms celery, causing a startup failure in cms, so we had to revert
it. Rather than waiting to fix that library, this commit collapses
the two instances together so that there is only ever one.

@feanil
Copy link
Contributor

feanil commented Dec 10, 2020

With this, it would be safe to remove the conditional import in both __init__.py files as well.

This should prevent the issues we've seen recently where cms modules are
imported by the running lms process, resulting in two celery instances
being created and tasks intermittently being registered to the wrong
instance (and therefore effectively lost.)

In commit ab6bf34/PR #25822 we tried to ensure that only one or the
other of the instances was created by adding a startup check.
Unfortunately, there's an external shared library that refers directly
to the lms celery, causing a startup failure in cms, so we had to revert
it. Rather than waiting to fix that library, this commit collapses
the two instances together so that there is only ever one.
@timmc-edx timmc-edx changed the title WIP - single celery by module Enforce a Celery singleton across cms and lms by using shared module Dec 10, 2020
@timmc-edx timmc-edx marked this pull request as ready for review December 10, 2020 15:54
@edx-status-bot
Copy link

Your PR has finished running tests. There were no failures.

@timmc-edx timmc-edx merged commit 0c57a02 into master Dec 10, 2020
@timmc-edx timmc-edx deleted the timmc/celery-highlander branch December 10, 2020 17:54
@feanil
Copy link
Contributor

feanil commented Dec 10, 2020

@nedbat this should be ported to Koa.

@pomegranited FYI, we think this was the core problem with all the celery woes.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@pomegranited
Copy link
Contributor

Gosh, what a pain this was to locate! So glad you all manged to find and fix it! Thanks for letting me know, @feanil .

nedbat pushed a commit that referenced this pull request Dec 11, 2020
…25840)

This should prevent the issues we've seen recently where cms modules are
imported by the running lms process, resulting in two celery instances
being created and tasks intermittently being registered to the wrong
instance (and therefore effectively lost.)

In commit ab6bf34/PR #25822 we tried to ensure that only one or the
other of the instances was created by adding a startup check.
Unfortunately, there's an external shared library that refers directly
to the lms celery, causing a startup failure in cms, so we had to revert
it. Rather than waiting to fix that library, this commit collapses
the two instances together so that there is only ever one.

(cherry picked from commit 0c57a02)
@nedbat
Copy link
Contributor

nedbat commented Dec 11, 2020

I have cherry-picked this to Koa.

regisb referenced this pull request in overhangio/tutor Dec 12, 2020
- [Bugfix] Fix missing celery tasks from edx-platform (see [upstream
PR](https://github.com/edx/edx-platform/pull/25840))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants