add trace logging to client nodes when sniffing of when ti connects to a node

This commit is contained in:
Shay Banon 2012-04-11 23:05:30 +03:00
parent ad07810610
commit c99d7ab8e1
1 changed files with 9 additions and 5 deletions

View File

@ -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<DiscoveryNode> 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<DiscoveryNode>().addAll(newNodes).build();