Skip to content

don't poison mutex around chalk - #1359

Merged
bors[bot] merged 1 commit into
masterfrom
antidote
Jun 1, 2019
Merged

bors[bot] merged 1 commit into
masterfrom
antidote

Conversation

@matklad

@matklad matklad commented Jun 1, 2019

Copy link
Copy Markdown
Contributor

No description provided.

We use panics for cancellation, so we could trigger panic while
holding the solver. std::sync::Mutex will be poisoned as a result,
which and all further attempts to use solver (from other threads) will
panic as well.

This commit switches to parking_lot::Mutex which just unlocks on panic.
@matklad

matklad commented Jun 1, 2019

Copy link
Copy Markdown
Contributor Author

bors r+
🤖

@matklad

matklad commented Jun 1, 2019

Copy link
Copy Markdown
Contributor Author

cc @flodiebold

bors Bot added a commit that referenced this pull request Jun 1, 2019
1359: don't poison mutex around chalk r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
@bors

bors Bot commented Jun 1, 2019

Copy link
Copy Markdown
Contributor

Build succeeded

@bors
bors Bot merged commit f89d34b into master Jun 1, 2019
@bors
bors Bot deleted the antidote branch June 1, 2019 08:11
@flodiebold

Copy link
Copy Markdown
Member

Ah 😄 TBH I don't have a good mental model for in what situations poisoning makes sense... Why did it panic at all?

@matklad

matklad commented Jun 1, 2019

Copy link
Copy Markdown
Contributor Author

Why did it panic at all?

We implement cancellation via panicking, so some dependent query got cancelled.

I don't have a good mental model for in what situations poisoning makes sense

Neither do I :)

@bjorn3

bjorn3 commented Jun 1, 2019

Copy link
Copy Markdown
Member

Poisoning makes sense when an operation temporarily brings data in an inconsistent state. It also helps propagating failure from one thread to another, so that when one thread fails other threads dont accidentially keep running when doing so is pointless.

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.

3 participants

⌂ Proxy