-
Notifications
You must be signed in to change notification settings - Fork 644
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 concurrency/consistency issues in Gallery API push #6600
Conversation
I don't understand why we even need this line. Isn't this checked at the beginning of the control and again (by the DB) on commit? Said another way, we already check it in memory here: NuGetGallery/src/NuGetGallery/Controllers/ApiController.cs Lines 599 to 602 in e582941
And the DB check it with a unique constraint on (PackageRegistrationKey, NormalizedVersion) on the packages table. What does this one add? Refers to: src/NuGetGallery/Services/PackageService.cs:478 in bee9def. [](commit_id = bee9def, deletion_comment = False) |
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.
🕐
@joelverhagen - technically we do not check for the conflict on DB commit, rather in the
I do not see any harm in handling it the current way in PR, given that it could avoid unnecessary queuing of validations and the check doesn't result in any performance issues(fail fast). |
I added the concurrency and sql constraint violations check for completion. |
Fixes https://github.com/NuGet/Engineering/issues/1817. Mostly affects the functional test failures, kind of hard to test but I will deploy this change to dev and run functional tests couple of times to verify.