From c99d7ab8e14e2eb6220977ee3d301747a19de055 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 11 Apr 2012 23:05:30 +0300 Subject: [PATCH] add trace logging to client nodes when sniffing of when ti connects to a node --- .../transport/TransportClientNodesService.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java b/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java index c155381e7f3..3f519bc28b5 100644 --- a/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java +++ b/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java @@ -324,6 +324,7 @@ public class TransportClientNodesService extends AbstractComponent { try { if (!transportService.nodeConnected(listedNode)) { try { + logger.trace("connecting to node [{}]", listedNode); transportService.connectToNode(listedNode); } catch (Exception e) { logger.debug("failed to connect to node [{}], ignoring...", e, listedNode); @@ -389,11 +390,14 @@ public class TransportClientNodesService extends AbstractComponent { // now, make sure we are connected to all the updated nodes for (Iterator it = newNodes.iterator(); it.hasNext(); ) { DiscoveryNode node = it.next(); - try { - transportService.connectToNode(node); - } catch (Exception e) { - it.remove(); - logger.debug("failed to connect to discovered node [" + node + "]", e); + if (!transportService.nodeConnected(node)) { + try { + logger.trace("connecting to node [{}]", node); + transportService.connectToNode(node); + } catch (Exception e) { + it.remove(); + logger.debug("failed to connect to discovered node [" + node + "]", e); + } } } nodes = new ImmutableList.Builder().addAll(newNodes).build();