-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: make course -> lib import synchronous #34030
feat: make course -> lib import synchronous #34030
Conversation
# TODO: This task is synchronous until we can figure out race conditions with import | ||
# These race conditions lead to failed imports of library content from course import. | ||
# See: TNL-TNL-11339, https://github.com/openedx/edx-platform/issues/34029 for more info. | ||
library_tasks.sync_from_library.apply( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.celeryq.dev/en/latest/reference/celery.app.task.html is how you know apply is the method to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion, but you if apply this and tests pass then LGTM.
Co-authored-by: Kyle McCormick <[email protected]>
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
On an openedx platform with async workers enabled,
If a course author uploads a course which references some library that exists already on the platform, they run into errors.
This is because xml_importer makes an async call to spawn the import of the content from the library
And then it proceeds to attempt to copy & publish the library content block's children, which leads to the likely state where the celery task has not copied in the LCB's new children, and this means that the publish cannot see the children, and fails.
In order to fix this, I am making the call to sync_from_library an
apply
call, not adelay
call, so that it operates synchronously until we figure out a long-term solution.Supporting information
https://2u-internal.atlassian.net/browse/TNL-11339
#34029