diff --git a/radicle-node/src/service.rs b/radicle-node/src/service.rs index 1d8575a5..88dd9106 100644 --- a/radicle-node/src/service.rs +++ b/radicle-node/src/service.rs @@ -1335,6 +1335,12 @@ where // In this scenario, it's possible that our peer is persistent, and // disconnected. We get an inbound connection before we attempt a re-connection, // and therefore we treat it as a regular inbound connection. + // + // It's also possible that a disconnection hasn't gone through yet and our + // peer is still in connected state here, while a new inbound connection from + // that same peer is made. This results in a new connection from a peer that is + // already connected from the perspective of the service. This appears to be + // a bug in the underlying networking library. let peer = e.get_mut(); debug!( target: "service", diff --git a/radicle-node/src/service/session.rs b/radicle-node/src/service/session.rs index 8510d677..beeb6ea8 100644 --- a/radicle-node/src/service/session.rs +++ b/radicle-node/src/service/session.rs @@ -231,7 +231,7 @@ impl Session { self.last_active = since; if let State::Connected { .. } = &self.state { - panic!("Session::to_connected: session is already in 'connected' state"); + log::error!(target: "service", "Session {} is already in 'connected' state, resetting..", self.id); }; self.state = State::Connected { since, diff --git a/radicle-node/src/wire/protocol.rs b/radicle-node/src/wire/protocol.rs index aed6a4a5..b4f903f2 100644 --- a/radicle-node/src/wire/protocol.rs +++ b/radicle-node/src/wire/protocol.rs @@ -491,7 +491,7 @@ where &DisconnectReason::connection(), ); } else { - log::warn!(target: "wire", "Tried to cleanup unknown peer with id={id} (fd={fd})"); + log::debug!(target: "wire", "Tried to cleanup unknown peer with id={id} (fd={fd})"); } } }