kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 55c1f9ccf66b0197bd88d7220f94a8fbbd1d51aeb0f799fbf28d28f32b5543ad |
|---|---|
| Author | Sylvain Lebresne <sylvain@datastax.com> · 2014-05-08 17:33 +02:00 |
| Committer | Sylvain Lebresne <sylvain@datastax.com> · 2014-05-08 17:33 +02:00 |
| Parents | 1210f1743d7c |
2 files changed
modified driver-core/CHANGELOG.rst +6 −0
| @@ -1,6 +1,12 @@ | ||
| 1 | 1 | CHANGELOG |
| 2 | 2 | ========= |
| 3 | 3 | |
| 4 | +1.0.8: | |
| 5 | +------ | |
| 6 | + | |
| 7 | +- [bug] Fix periodic reconnection to down hosts (JAVA-325) | |
| 8 | + | |
| 9 | + | |
| 4 | 10 | 1.0.7: |
| 5 | 11 | ------ |
| 6 | 12 |
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +8 −2
| @@ -994,9 +994,15 @@ | ||
| 994 | 994 | if (host.reconnectionAttempt.get() != null) |
| 995 | 995 | return; |
| 996 | 996 | |
| 997 | + // Remember if we care about this node at all. We must call this before | |
| 998 | + // we've signalled the load balancing policy, since most policy will always | |
| 999 | + // IGNORE down nodes anyway. | |
| 1000 | + HostDistance distance = loadBalancingPolicy().distance(host); | |
| 1001 | + | |
| 997 | 1002 | boolean wasUp = host.isUp(); |
| 998 | 1003 | host.setDown(); |
| 999 | 1004 | |
| 1005 | + | |
| 1000 | 1006 | loadBalancingPolicy().onDown(host); |
| 1001 | 1007 | controlConnection.onDown(host); |
| 1002 | 1008 | for (SessionManager s : sessions) |
| @@ -1011,7 +1017,7 @@ | ||
| 1011 | 1017 | } |
| 1012 | 1018 | |
| 1013 | 1019 | // Don't start a reconnection if we ignore the node anyway (JAVA-314) |
| 1014 | - if (loadBalancingPolicy().distance(host) == HostDistance.IGNORED) | |
| 1020 | + if (distance == HostDistance.IGNORED) | |
| 1015 | 1021 | return; |
| 1016 | 1022 | |
| 1017 | 1023 | // Note: we basically waste the first successful reconnection, but it's probably not a big deal |
| @@ -1119,7 +1125,7 @@ | ||
| 1119 | 1125 | |
| 1120 | 1126 | host.setDown(); |
| 1121 | 1127 | |
| 1122 | - logger.trace("Removing host {}", host); | |
| 1128 | + logger.debug("Removing host {}", host); | |
| 1123 | 1129 | loadBalancingPolicy().onRemove(host); |
| 1124 | 1130 | controlConnection.onRemove(host); |
| 1125 | 1131 | for (SessionManager s : sessions) |