Elffuss BraidHub

kikocis/java-driver public

JAVA-1202: Handle null rpc_address when checking schema agreement. (#684)

Changesetcbe1bc533f9e459271017d677cdbac27703007674c6e51b66dc51874425a0b20
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2016-06-27 11:19 -07:00
CommitterGitHub <noreply@github.com> · 2016-06-27 11:19 -07:00
Parentsba109c0e72ce

Browse the files at this changeset

2 files changed

modified changelog/README.md +1 −0
@@ -11,6 +11,7 @@
1111 - [bug] JAVA-1187: Fix warning message when local CL used with RoundRobinPolicy.
1212 - [improvement] JAVA-1175: Warn if DCAwarePolicy configuration is inconsistent.
1313 - [bug] JAVA-1139: ConnectionException.getMessage() throws NPE if address is null.
14+- [bug] JAVA-1202: Handle null rpc_address when checking schema agreement.
1415
1516
1617 ### 3.0.2
modified driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +3 −1
@@ -383,11 +383,13 @@
383383
384384 if (broadcastAddress == null) {
385385 return null;
386- } else if (broadcastAddress.equals(connectedHost.getAddress()) || rpcAddress.equals(connectedHost.getAddress())) {
386+ } else if (broadcastAddress.equals(connectedHost.getAddress()) || (rpcAddress != null && rpcAddress.equals(connectedHost.getAddress()))) {
387387 // Some DSE versions were inserting a line for the local node in peers (with mostly null values). This has been fixed, but if we
388388 // detect that's the case, ignore it as it's not really a big deal.
389389 logger.debug("System.peers on node {} has a line for itself. This is not normal but is a known problem of some DSE version. Ignoring the entry.", connectedHost);
390390 return null;
391+ } else if (rpcAddress == null) {
392+ return null;
391393 } else if (rpcAddress.equals(bindAllAddress)) {
392394 logger.warn("Found host with 0.0.0.0 as rpc_address, using broadcast_address ({}) to contact it instead. If this is incorrect you should avoid the use of 0.0.0.0 server side.", broadcastAddress);
393395 rpcAddress = broadcastAddress;