Closed nikomatsakis closed 5 years ago
@kleimkuhler if you want to see this through, feel free to assign yourself. =)
We need to add a poisoned
flag to LocalState
:
We need to create a PanicGuard
type in execute_query_implementation
that will -- upon panic -- set this flag to true (we can use std::mem::forget
to prevent the guard from executing upon a normal return):
We probably want to check the panic guard flag in that same function and panic if it is true. There may be other places where it makes sense to check, but that's a good starting point.
I created a Zulip topic for this issue
Discussion topic
Edit: Moved to https://github.com/salsa-rs/salsa/pull/89
Actually, we've decided to make the database handles recover from panics, as part of our cancellation mechanism (and, afaik, they currently do). See https://github.com/salsa-rs/salsa/pull/114
Continuing the conversation with @kleimkuhler from https://github.com/salsa-rs/salsa/pull/81, I think we should not attempt to make an individual database handle panic safe, but we should instead poision the handles so that -- if they are used again -- you get an immediate panic. You can still recover from panics by using snapshots.
What I wrote in #81 was as follows: