Add listener nodes to nodes list if 'sniff' is true
TransportClient doesn't add the initial nodes to the nodes list if it doesn't retrieve any nodes from the listeners which can cause the transport client to throw a 'NoNodeAvailableException' if the 'sniff' response didn't return any nodes. This situation can occure if the client tries to get the listener nodes cluster state while that node is not yet connected to any other nodes.
This commit is contained in:
parent
7c032f6af6
commit
e1aa91dc81
|
@ -419,7 +419,7 @@ public class TransportClientNodesService extends AbstractComponent {
|
|||
return;
|
||||
}
|
||||
|
||||
HashSet<DiscoveryNode> newNodes = new HashSet<DiscoveryNode>();
|
||||
HashSet<DiscoveryNode> newNodes = new HashSet<DiscoveryNode>(listedNodes);
|
||||
for (ClusterStateResponse clusterStateResponse : clusterStateResponses) {
|
||||
if (!ignoreClusterName && !clusterName.equals(clusterStateResponse.getClusterName())) {
|
||||
logger.warn("node {} not part of the cluster {}, ignoring...", clusterStateResponse.getState().nodes().localNode(), clusterName);
|
||||
|
|
Loading…
Reference in New Issue