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

prevent race conditions when initializing crate record in DB #2482

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

syphar
Copy link
Member

@syphar syphar commented Apr 5, 2024

With this I'm trying to prevent this sentry error while building:

error returned from database: duplicate key value violates unique constraint "crates_normalized_name_idx"

I'm not sure yet where this can happen, I saw it once specifically with the crate tencent (which is empty, but this shouldn't matter). Crate name normalization shouldn't change anything for this crate. Also the crate was queued only once in the queue, and SELECT FOR UPDATE should prevent that the second builder would pick up the same release.

In any case, this is the new impl for the method, taken from #2467, which would solve this specific error in all cases.

@syphar syphar requested a review from a team as a code owner April 5, 2024 03:44
@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Apr 5, 2024
@syphar syphar merged commit bc86a4d into rust-lang:master Apr 17, 2024
9 checks passed
@syphar syphar deleted the initialize-crate-race branch April 17, 2024 14:01
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Apr 17, 2024
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Apr 17, 2024
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.

2 participants