-
Notifications
You must be signed in to change notification settings - Fork 12
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
Don't use .save() in validate_version_metadata #1800
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jjnesbitt
commented
Dec 30, 2023
|
jjnesbitt
force-pushed
the
fix-incorrect-assets-summary
branch
from
January 1, 2024 20:23
c87aed5
to
1298ea2
Compare
jjnesbitt
force-pushed
the
fix-incorrect-assets-summary
branch
4 times, most recently
from
January 18, 2024 21:28
88593e6
to
587928a
Compare
jjnesbitt
force-pushed
the
fix-incorrect-assets-summary
branch
from
February 13, 2024 15:29
587928a
to
4d21e35
Compare
jjnesbitt
force-pushed
the
fix-incorrect-assets-summary
branch
from
February 13, 2024 15:31
4d21e35
to
11bfd89
Compare
mvandenburgh
approved these changes
Feb 14, 2024
jjnesbitt
added
patch
Increment the patch version when merged
release
Create a release when this pr is merged
labels
Feb 14, 2024
🚀 PR was released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're seeing a very prevalent race condition, resulting in version asset summary aggregations being skipped (this can be observed via copious amounts of
Skipped updating assetsSummary for version ***
in the papertrail logs).Here's what I believe is happening:
PENDING
validate_draft_version_metadata
is run, dispatching thevalidate_version_metadata
andaggregate_assets_summary
tasks at the same timevalidate_version_metadata
finishes beforeaggregate_assets_summary
, callingVersion.save()
, which callsVersion._populate_metadata
, potentially modifying the metadataaggregate_assets_summary
finishes generating the summary and reaches this line, which will only update the version if themetadata
field hasn't changed from when the task was dispatched. Since the above step modifies the metadata, this filter fails and the update is skippedThis PR changes the behavior of
validate_version_metadata
to use.update
when updating thestatus
andvalidation_errors
of a Version, subverting the underlying call toVersion._populate_metadata
, and thus any metadata changes.@danlamanna I'd like to hear your input on this, particularly to make sure I'm not violating any intended behavior. I believe I've largely kept in line with what was already there, but I'm unfamiliar with the reason/need for using the
metadata=version.metadata
filter when updating a version's asset summary.