clean connected nodes when closing a client

This commit is contained in:
Shay Banon 2011-07-25 15:25:10 +03:00
parent 549e9c7019
commit 7bdae651c3
1 changed files with 6 additions and 1 deletions

View File

@ -157,8 +157,13 @@ public class TransportClientNodesService extends AbstractComponent {
public void close() { public void close() {
closed = true; closed = true;
nodesSamplerFuture.cancel(true); nodesSamplerFuture.cancel(true);
for (DiscoveryNode listedNode : listedNodes) for (DiscoveryNode node : nodes) {
transportService.disconnectFromNode(node);
}
for (DiscoveryNode listedNode : listedNodes) {
transportService.disconnectFromNode(listedNode); transportService.disconnectFromNode(listedNode);
}
nodes = ImmutableList.of();
} }
interface NodeSampler { interface NodeSampler {