2626use std:: {
2727 io,
2828 sync:: {
29- Arc ,
29+ Arc , Mutex ,
3030 atomic:: { AtomicU64 , Ordering } ,
3131 } ,
3232 time:: { Duration , Instant } ,
@@ -214,7 +214,7 @@ struct Inner {
214214 connection : AtomicU64 ,
215215 exhausted : AtomicU64 ,
216216 unknown : AtomicU64 ,
217- state : parking_lot :: Mutex < State > ,
217+ state : Mutex < State > ,
218218}
219219
220220struct State {
@@ -235,7 +235,7 @@ impl Health {
235235 connection : AtomicU64 :: new ( 0 ) ,
236236 exhausted : AtomicU64 :: new ( 0 ) ,
237237 unknown : AtomicU64 :: new ( 0 ) ,
238- state : parking_lot :: Mutex :: new ( State {
238+ state : Mutex :: new ( State {
239239 stall : None ,
240240 consecutive : 0 ,
241241 delay : RETRY_MIN ,
@@ -251,7 +251,7 @@ impl Health {
251251 /// An accept succeeded: the listener is serving, so any stall is over and the
252252 /// next failure starts from the shortest delay again.
253253 pub fn accepted ( & self ) {
254- let mut state = self . 0 . state . lock ( ) ;
254+ let mut state = self . 0 . state . lock ( ) . unwrap ( ) ;
255255 if state. stall . take ( ) . is_some ( ) {
256256 tracing:: info!( listener = self . 0 . listener, "listener is accepting again" ) ;
257257 }
@@ -276,7 +276,7 @@ impl Health {
276276 return None ;
277277 }
278278
279- let mut state = self . 0 . state . lock ( ) ;
279+ let mut state = self . 0 . state . lock ( ) . unwrap ( ) ;
280280 state. consecutive += 1 ;
281281 let delay = jitter ( state. delay ) ;
282282 state. delay = ( state. delay * 2 ) . min ( RETRY_MAX ) ;
@@ -316,7 +316,7 @@ impl Health {
316316 /// Only a successful accept clears it, so a listener with no traffic holds its
317317 /// last value rather than claiming a recovery it has no evidence for.
318318 pub fn stalled ( & self ) -> Option < Duration > {
319- self . 0 . state . lock ( ) . stall . map ( |since| since. elapsed ( ) )
319+ self . 0 . state . lock ( ) . unwrap ( ) . stall . map ( |since| since. elapsed ( ) )
320320 }
321321
322322 fn counter ( & self , failure : Failure ) -> & AtomicU64 {
0 commit comments