IncomingStreamingConnection version check message wrong patch by Ryan Magnusson reviewed by Robert Stupp for CASSANDRA-11462
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a33038be Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a33038be Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a33038be Branch: refs/heads/trunk Commit: a33038be23e4114f5b6f0736887d35656b0aa40f Parents: 1ff9df7 Author: Ryan Magnusson <ryan.magnus...@gmail.com> Authored: Mon Apr 4 14:09:54 2016 +0200 Committer: Robert Stupp <sn...@snazy.de> Committed: Mon Apr 4 14:09:54 2016 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../apache/cassandra/net/IncomingStreamingConnection.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a33038be/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 4c81a98..b6438b8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.6 + * IncomingStreamingConnection version check message wrong (CASSANDRA-11462) * DatabaseDescriptor should log stacktrace in case of Eception during seed provider creation (CASSANDRA-11312) * Use canonical path for directory in SSTable descriptor (CASSANDRA-10587) * Add cassandra-stress keystore option (CASSANDRA-9325) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a33038be/src/java/org/apache/cassandra/net/IncomingStreamingConnection.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/net/IncomingStreamingConnection.java b/src/java/org/apache/cassandra/net/IncomingStreamingConnection.java index 842676d..79a814d 100644 --- a/src/java/org/apache/cassandra/net/IncomingStreamingConnection.java +++ b/src/java/org/apache/cassandra/net/IncomingStreamingConnection.java @@ -56,9 +56,10 @@ public class IncomingStreamingConnection extends Thread implements Closeable { try { - // streaming connections are per-session and have a fixed version. we can't do anything with a wrong-version stream connection, so drop it. + // streaming connections are per-session and have a fixed version. + // we can't do anything with a wrong-version stream connection, so drop it. if (version != StreamMessage.CURRENT_VERSION) - throw new IOException(String.format("Received stream using protocol version %d (my version %d). Terminating connection", version, MessagingService.current_version)); + throw new IOException(String.format("Received stream using protocol version %d (my version %d). Terminating connection", version, StreamMessage.CURRENT_VERSION)); DataInput input = new DataInputStream(socket.getInputStream()); StreamInitMessage init = StreamInitMessage.serializer.deserialize(input, version); @@ -75,7 +76,9 @@ public class IncomingStreamingConnection extends Thread implements Closeable } catch (IOException e) { - logger.trace("IOException reading from socket; closing", e); + logger.error(String.format("IOException while reading from socket from %s, closing: %s", + socket.getRemoteSocketAddress(), e)); + logger.trace(String.format("IOException while reading from socket from %s, closing", socket.getRemoteSocketAddress()), e); close(); } }