Elffuss BraidHub

kikocis/java-driver public

Fix bug in JAVA-428 changes.
Changeset26add0c6583f8ea5bd8d0812d6b2dc966506bd0c4d4323b48b3aa08e58fdaa33
Authorolim7t <omichallat+github@gmail.com> · 2014-08-29 13:07 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2014-08-29 13:07 +02:00
Parents724881bcc920

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +9 −2
@@ -411,8 +411,15 @@
411411 logger.debug("[Control connection] Refreshing node info on {}", host);
412412 Row row = fetchNodeInfo(host, c);
413413 if (row == null) {
414- logger.error("No row found for host {} in {}'s peers system table. {} will be ignored.", host.getAddress(), c.address, host.getAddress());
415- return false;
414+ if (c.isDefunct()) {
415+ logger.debug("Control connection is down, could not refresh node info");
416+ // Keep going with what we currently know about the node, otherwise we will ignore all nodes
417+ // until the control connection is back up (which leads to a catch-22 if there is only one)
418+ return true;
419+ } else {
420+ logger.error("No row found for host {} in {}'s peers system table. {} will be ignored.", host.getAddress(), c.address, host.getAddress());
421+ return false;
422+ }
416423 } else if (row.getInet("rpc_address") == null) {
417424 logger.error("No rpc_address found for host {} in {}'s peers system table. {} will be ignored.", host.getAddress(), c.address, host.getAddress());
418425 return false;