-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Clean deletion of a Version #3743
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
Comments
We can use Celery task chaining to accomplish this probably. |
Actually, we delete the versions when syncing the versions I'm not sure about chaining the tasks. What I understand, is that we access to the versions from the So at least that |
What would the race condition here be? If we remove a version and try to symlink, does the symlink stay? |
|
When a Version is deleted, we are triggering
clear_artifacts
andsymlink_project
but the later is triggered before the object deletion; so, I think if the task is ran before it's effectively deleted the symlink won't be properly synced:https://github.com/rtfd/readthedocs.org/blob/5472906a067adc60f42556108993255393408410/readthedocs/builds/models.py#L181-L187
To fix this we could chain some Celery task in this order:
clear_artifacts
symlink_projects
Take into account that the first and last have to be executed in a broadcast call but the second one should be executed just once since it affects the database.
Ref: #3649 (comment)
The text was updated successfully, but these errors were encountered: