From 7b3d380ceb5e268b28c2ada97dde0652d7ecb35b Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 19 Jan 2024 16:32:01 +0100 Subject: [PATCH] node: Fix connection attempt tracking When a DNS error occured, the `dial` call failed and we didn't get a connection attempt, just a disconnect. We fix that by always calling back into the service when we attempt a connection. --- radicle-node/src/wire/protocol.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicle-node/src/wire/protocol.rs b/radicle-node/src/wire/protocol.rs index e9e6434f..ffd18089 100644 --- a/radicle-node/src/wire/protocol.rs +++ b/radicle-node/src/wire/protocol.rs @@ -773,6 +773,7 @@ where ); continue; } + self.service.attempted(node_id, addr.clone()); match dial::( addr.to_inner(), @@ -785,7 +786,6 @@ where NetTransport::>::with_session(session, Link::Outbound) }) { Ok(transport) => { - self.service.attempted(node_id, addr.clone()); self.outbound.insert( transport.as_raw_fd(), Outbound { @@ -798,7 +798,7 @@ where .push_back(reactor::Action::RegisterTransport(transport)); } Err(err) => { - log::error!(target: "wire", "Error establishing connection: {err}"); + log::error!(target: "wire", "Error establishing connection to {addr}: {err}"); self.service .disconnected(node_id, &DisconnectReason::Dial(Arc::new(err)));