From 608da1f4195ebfd7c99add8ec9f3ef236cac47df Mon Sep 17 00:00:00 2001 From: Stan Bondi Date: Tue, 7 Mar 2023 15:50:37 +0400 Subject: [PATCH] review comments: add comment explaining pool --- comms/core/src/connectivity/manager.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comms/core/src/connectivity/manager.rs b/comms/core/src/connectivity/manager.rs index 2ba8bd5098..0f809a7a36 100644 --- a/comms/core/src/connectivity/manager.rs +++ b/comms/core/src/connectivity/manager.rs @@ -315,6 +315,7 @@ impl ConnectivityManagerActor { }, } match self.pool.get(&node_id) { + // The connection pool may temporarily contain a connection that is not connected so we need to check this. Some(state) if state.is_connected() => { if let Some(reply_tx) = reply_tx { let _result = reply_tx.send(Ok(state.connection().cloned().expect("Already checked"))); @@ -323,7 +324,7 @@ impl ConnectivityManagerActor { maybe_state => { info!( target: LOG_TARGET, - "No connection found for peer (status={}) `{}`. Dialing...", + "Connection is not connected (status={}) `{}`. Dialing...", maybe_state .map(|s| s.status().to_string()) .unwrap_or_else(|| "NotConnected".to_string()),