You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a different crate name in a test to prevent deadlocks
This test does a lot of different manipulations of categories and crate
categories and it was using a crate named foo. The good_categories test
also used a crate named foo, and these two tests were causing a postgres
deadlock.
I was able to cause deadlocks more often by duplicating the update_crate
test and the good_categories test:
https://travis-ci.org/integer32llc/crates.io/builds/187302718
Making this change and running the duplicated tests resulted in 0
deadlocks:
https://travis-ci.org/integer32llc/crates.io/builds/187306433
This is unlikely to happen in production; requests get a database
connection that gets closed when the request finishes, and the publish
request only modifies the categories once, not as much as the
update_crate test is. It seems unlikely that two people would publish
the same crate at exactly the same time.
0 commit comments