Skip to content

Commit

Permalink
Possible failure when using TransportClient (with sniffing), closes e…
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed May 10, 2011
1 parent d0950dc commit e275423
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.elasticsearch.transport.*;

import java.util.HashSet;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ScheduledFuture;
Expand Down Expand Up @@ -255,11 +256,12 @@ private class ScheduledSniffNodesSampler implements Runnable {
}
}
// now, make sure we are connected to all the updated nodes
for (DiscoveryNode node : newNodes) {
for (Iterator<DiscoveryNode> it = newNodes.iterator(); it.hasNext();) {
DiscoveryNode node = it.next();
try {
transportService.connectToNode(node);
} catch (Exception e) {
newNodes.remove(node);
it.remove();
logger.debug("Failed to connect to discovered node [" + node + "]", e);
}
}
Expand Down

0 comments on commit e275423

Please sign in to comment.