Peer disconnect message - add client info (#6947)

* add client info to disconnect message

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* exclude disconnect reason message since it makes it harder to analyse

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/6964/head
Sally MacFarlane 7 months ago committed by GitHub
parent 4dd9c65ff7
commit b5b7b9f5f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java

@ -425,16 +425,18 @@ public class EthProtocolManager implements ProtocolManager, MinedBlockObserver {
final PeerConnection connection,
final DisconnectReason reason,
final boolean initiatedByPeer) {
if (ethPeers.registerDisconnect(connection)) {
LOG.atDebug()
.setMessage("Disconnect - {} - {} - {} - {} peers left")
.addArgument(initiatedByPeer ? "Inbound" : "Outbound")
.addArgument(reason::toString)
.addArgument(() -> connection.getPeer().getLoggableId())
.addArgument(ethPeers::peerCount)
.log();
LOG.atTrace().setMessage("{}").addArgument(ethPeers::toString).log();
}
final boolean wasActiveConnection = ethPeers.registerDisconnect(connection);
LOG.atDebug()
.setMessage("Disconnect - active Connection? {} - {} - {} {} - {} {} - {} peers left")
.addArgument(wasActiveConnection)
.addArgument(initiatedByPeer ? "Inbound" : "Outbound")
.addArgument(reason::getValue)
.addArgument(reason::name)
.addArgument(() -> connection.getPeer().getLoggableId())
.addArgument(() -> connection.getPeerInfo().getClientId())
.addArgument(ethPeers::peerCount)
.log();
LOG.atTrace().setMessage("{}").addArgument(ethPeers::toString).log();
}
private void handleStatusMessage(final EthPeer peer, final Message message) {

Loading…
Cancel
Save