File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -235,9 +235,11 @@ impl<C> SyncConnectionWrapper<C> {
235
235
{
236
236
let inner = self . inner . clone ( ) ;
237
237
tokio:: task:: spawn_blocking ( move || {
238
- let mut inner = inner
239
- . lock ( )
240
- . expect ( "Mutex is poisoned, a thread must have panicked holding it." ) ;
238
+ let mut inner = inner. lock ( ) . unwrap_or_else ( |poison| {
239
+ // try to be resilient by providing the guard
240
+ inner. clear_poison ( ) ;
241
+ poison. into_inner ( )
242
+ } ) ;
241
243
task ( & mut inner)
242
244
} )
243
245
. unwrap_or_else ( |err| QueryResult :: Err ( from_tokio_join_error ( err) ) )
@@ -268,9 +270,11 @@ impl<C> SyncConnectionWrapper<C> {
268
270
269
271
let ( collect_bind_result, collector_data) = {
270
272
let exclusive = self . inner . clone ( ) ;
271
- let mut inner = exclusive
272
- . lock ( )
273
- . expect ( "Mutex is poisoned, a thread must have panicked holding it." ) ;
273
+ let mut inner = exclusive. lock ( ) . unwrap_or_else ( |poison| {
274
+ // try to be resilient by providing the guard
275
+ exclusive. clear_poison ( ) ;
276
+ poison. into_inner ( )
277
+ } ) ;
274
278
let mut bind_collector =
275
279
<<C :: Backend as Backend >:: BindCollector < ' _ > as Default >:: default ( ) ;
276
280
let metadata_lookup = inner. metadata_lookup ( ) ;
You can’t perform that action at this time.
0 commit comments