Elffuss BraidHub

kikocis/java-driver public

Don't try to reconnect to nodes that are ignored by the load balancing policy

JAVA-314 #fixes
Changeset1210f1743d7c2ae3e076528f226ecd8d3f65f9dfb3f58323740941075d64ab21
AuthorSylvain Lebresne <sylvain@datastax.com> · 2014-05-05 11:00 +02:00
CommitterSylvain Lebresne <sylvain@datastax.com> · 2014-05-05 11:00 +02:00
Parents64954d6d69df

Browse the files at this changeset

2 files changed

modified driver-core/CHANGELOG.rst +1 −0
@@ -9,6 +9,7 @@
99 - [new] Add new WhiteListPolicy to limit the nodes connected to a particular list
1010 - [improvement] Do not hop DC for LOCAL_* CL in DCAwareRoundRobinPolicy (JAVA-289)
1111 - [bug] Revert back to longs for dates in the query builder (JAVA-313)
12+- [bug] Don't reconnect to nodes ignored by the load balancing policy (JAVA-314)
1213
1314
1415 1.0.6:
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +4 −0
@@ -1010,6 +1010,10 @@
10101010 listener.onDown(host);
10111011 }
10121012
1013+ // Don't start a reconnection if we ignore the node anyway (JAVA-314)
1014+ if (loadBalancingPolicy().distance(host) == HostDistance.IGNORED)
1015+ return;
1016+
10131017 // Note: we basically waste the first successful reconnection, but it's probably not a big deal
10141018 logger.debug("{} is down, scheduling connection retries", host);
10151019 new AbstractReconnectionHandler(reconnectionExecutor, reconnectionPolicy().newSchedule(), host.reconnectionAttempt) {