From 966996542e7be7b5aaa9e6fa34f2be0238ecc425 Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:52:01 +0200 Subject: [PATCH] chore(connmanager): also show peerID and dir when too many conns (#1185) Bring a bit more detail when the "Too many connections for peer" message is being logged. Particularly, we are adding the offending `peerId` and the stream direction Co-authored-by: diegomrsantos --- libp2p/connmanager.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libp2p/connmanager.nim b/libp2p/connmanager.nim index 596b87b18..685b506ad 100644 --- a/libp2p/connmanager.nim +++ b/libp2p/connmanager.nim @@ -296,7 +296,8 @@ proc storeMuxer*(c: ConnManager, muxer: Muxer) {.raises: [CatchableError].} = if expectedConn != nil and not expectedConn.finished: expectedConn.complete(muxer) else: - debug "Too many connections for peer", conns = c.muxed.getOrDefault(peerId).len + debug "Too many connections for peer", + conns = c.muxed.getOrDefault(peerId).len, peerId, dir raise newTooManyConnectionsError()