Would it be feasible or even make sense to implement UnwindSafe for the managed::Pool type?
Some context: I've decided to replace r2d2 with deadpool-diesel for database connection pooling in an application because r2d2 has a serious flaw in the way it handles panics (see diesel-rs/diesel#2124, diesel-rs/diesel#2105, diesel-rs/diesel#2020, sfackler/r2d2#70).
The managed::Pool type not being UnwindSafe prevents certain use cases such as passing the pool to an async function that may panic but where the panic needs to be caught. As far as I can tell, because pooled objects are wrapped in a Mutex and deadpool discards poisoned mutexes, there's no risk of reusing an invalid pooled object. (At least this is the case with the diesel and sqlite implementations.)
Would it be feasible or even make sense to implement
UnwindSafefor themanaged::Pooltype?Some context: I've decided to replace r2d2 with deadpool-diesel for database connection pooling in an application because r2d2 has a serious flaw in the way it handles panics (see diesel-rs/diesel#2124, diesel-rs/diesel#2105, diesel-rs/diesel#2020, sfackler/r2d2#70).
The
managed::Pooltype not beingUnwindSafeprevents certain use cases such as passing the pool to an async function that may panic but where the panic needs to be caught. As far as I can tell, because pooled objects are wrapped in a Mutex and deadpool discards poisoned mutexes, there's no risk of reusing an invalid pooled object. (At least this is the case with thedieselandsqliteimplementations.)