File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use serde:: { Deserialize , Serialize , Serializer } ;
2+ use std:: fmt:: Display ;
23
34use crate :: internal:: common:: error:: DsError ;
45use crate :: internal:: messages:: common:: TaskFailInfo ;
@@ -303,6 +304,18 @@ impl LostWorkerReason {
303304 }
304305}
305306
307+ impl Display for LostWorkerReason {
308+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
309+ f. write_str ( match self {
310+ LostWorkerReason :: Stopped => "stopped" ,
311+ LostWorkerReason :: ConnectionLost => "connection lost" ,
312+ LostWorkerReason :: HeartbeatLost => "heartbeat lost" ,
313+ LostWorkerReason :: IdleTimeout => "idle timeout" ,
314+ LostWorkerReason :: TimeLimitReached => "time limit reached" ,
315+ } )
316+ }
317+ }
318+
306319#[ derive( Serialize , Deserialize , Debug ) ]
307320pub struct LostWorkerMessage {
308321 pub worker_id : WorkerId ,
Original file line number Diff line number Diff line change @@ -230,9 +230,10 @@ async fn worker_rpc_loop(
230230 } ;
231231
232232 log:: info!(
233- "Worker {} connection closed (connection : {}) " ,
233+ "Worker {} ({}) connection closed: {}" ,
234234 worker_id,
235- connection. address
235+ connection. address,
236+ reason
236237 ) ;
237238 let mut core = core_ref. get_mut ( ) ;
238239 let mut comm = comm_ref. get_mut ( ) ;
You can’t perform that action at this time.
0 commit comments