Unicast discovery: only disconnect from temporary connected nodes

In unicast discovery, we try to reuse existing discovery nodes based on the node address they have. If we find an existing node based on its address, and for some reason its not connected, don't add it to the list of nodes to disconnect from, as that (full) connection is useful down the road
closes #6966
This commit is contained in:
Shay Banon 2014-07-22 19:03:08 +02:00
parent 88f3afe4b5
commit 50ececbbcf
1 changed files with 6 additions and 1 deletions

View File

@ -270,7 +270,12 @@ public class UnicastZenPing extends AbstractLifecycleComponent<ZenPing> implemen
if (sendPingsHandler.isClosed()) {
return;
}
sendPingsHandler.nodeToDisconnect.add(nodeToSend);
// only disconnect from nodes that we will end up creating a light connection to, as they are temporal
// if we find on the disco nodes a matching node by address, we are going to restore the connection
// anyhow down the line if its not connected...
if (!nodeFoundByAddress) {
sendPingsHandler.nodeToDisconnect.add(nodeToSend);
}
// fork the connection to another thread
sendPingsHandler.executor().execute(new Runnable() {
@Override