diff --git a/chain/network/src/peer.rs b/chain/network/src/peer.rs index 026ef16aa64..38abff9f029 100644 --- a/chain/network/src/peer.rs +++ b/chain/network/src/peer.rs @@ -184,6 +184,14 @@ pub struct Peer { peer_counter: Arc, } +impl Drop for Peer { + fn drop(&mut self) { + eprintln!("will drop Peer"); + std::thread::sleep(std::time::Duration::from_millis(250)); + eprintln!("did drop Peer"); + } +} + impl Peer { pub fn new( node_info: PeerInfo, diff --git a/chain/network/src/peer_manager.rs b/chain/network/src/peer_manager.rs index efb35cd72be..092f80fc53e 100644 --- a/chain/network/src/peer_manager.rs +++ b/chain/network/src/peer_manager.rs @@ -154,6 +154,14 @@ pub struct PeerManagerActor { scheduled_routing_table_update: bool, } +impl Drop for PeerManagerActor { + fn drop(&mut self) { + eprintln!("will drop PeerManagerActor"); + std::thread::sleep(std::time::Duration::from_millis(250)); + eprintln!("did drop PeerManagerActor"); + } +} + impl PeerManagerActor { pub fn new( store: Arc,