Here's the interact method, for reference:
https://github.com/bikeshedder/deadpool/blob/2c7a0b7aee915e775f8d751e0a73ec884bae6f71/sqlite/src/lib.rs#L136-L146
If f() panics, it will do so while the lock is held. This poisons the lock. Every attempt to interact() thereafter will panic!() because of the unwrap() on line 144 (itself because of the unwrap() in 142). I would suggest the following changes:
- Use a non-poisoning lock, like
parking_lot::Mutex().
- Propagate errors from
spawn_blocking(), don't panic.
Alternatively, detect the error and close the connection so that the poisoned mutex is never reused.