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

Avoid lock poisoning by using parking_lot #1599

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

rtzoeller
Copy link
Collaborator

The synchronization primitives in the standard library are not panic-safe, however the parking_lot crate provides drop-in replacement primitives which are.

Add the parking_lot crate as a dev dependency and update the tests to use it. This should make it easier to narrow down which test(s) in a group of tests are actually failing, since the entire group will no longer fail due to poisoning.

parking_lot provides synchronization primitives which aren't
poisoned on panic. This makes it easier to determine which tests
are failing, as a test failure no longer causes all subsequent tests
using that mutex to fail.
@rtzoeller
Copy link
Collaborator Author

@asomers I'm not particularly attached to these changes, but they would have simplified some debugging I did at one point. The changes are also easy enough to recreate, should we want to rebase it onto other changes (like #1498).

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I didn't know that about parking_lot.

bors r+

@bors bors bot merged commit 055818a into nix-rust:master Nov 29, 2021
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