Skip to content

Commit

Permalink
Add discoveryNode to PeersFinder.Peer.toString() and remove from log …
Browse files Browse the repository at this point in the history
…messages
  • Loading branch information
DaveCTurner committed Aug 6, 2018
1 parent 221253a commit e5414a1
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void handleWakeUp() {
requestPeers();
}
} else {
logger.trace("{} no longer connected to {}", this, discoveryNode);
logger.trace("{} no longer connected to {}", this);
removePeer();
}
}
Expand Down Expand Up @@ -314,7 +314,7 @@ private void requestPeers() {
final DiscoveryNode discoveryNode = getDiscoveryNode();
assert discoveryNode != null : "cannot request peers without first connecting";

logger.trace("{} requesting peers from {}", this, discoveryNode);
logger.trace("{} requesting peers", this);
peersRequestInFlight = true;

List<DiscoveryNode> knownNodes = getFoundPeersUnderLock();
Expand All @@ -330,7 +330,7 @@ public PeersResponse read(StreamInput in) throws IOException {

@Override
public void handleResponse(PeersResponse response) {
logger.trace("{} received {} from {}", Peer.this, response, discoveryNode);
logger.trace("{} received {}", Peer.this, response);
synchronized (mutex) {
if (active == false) {
return;
Expand All @@ -352,7 +352,7 @@ public void handleResponse(PeersResponse response) {
@Override
public void handleException(TransportException exp) {
peersRequestInFlight = false;
logger.debug("PeersRequest failed", exp);
logger.debug(new ParameterizedMessage("{} peers request failed", this), exp);
}

@Override
Expand All @@ -364,7 +364,11 @@ public String executor() {

@Override
public String toString() {
return "Peer{" + transportAddress + " peersRequestInFlight=" + peersRequestInFlight + "}";
return "Peer{" +
"transportAddress=" + transportAddress +
", discoveryNode=" + discoveryNode.get() +
", peersRequestInFlight=" + peersRequestInFlight +
'}';
}
}
}

0 comments on commit e5414a1

Please sign in to comment.