From a6ff20d25da2af9d0081b0b6f60045c6e71aa571 Mon Sep 17 00:00:00 2001 From: Shweta Date: Fri, 24 May 2019 18:41:45 +0200 Subject: [PATCH] HDFS-14451. Incorrect header or version mismatch log message. Contributed by Shweta. Signed-off-by: Wei-Chiu Chuang (cherry picked from commit 93d7630062247793a4860704fad4a31437693de1) (cherry picked from commit 7a5d9ab9eed194fabe609def69efe41bea4ed1f6) --- .../main/java/org/apache/hadoop/ipc/Server.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java index 041b2b4caf7..196b3d1db5f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java @@ -2066,11 +2066,17 @@ public abstract class Server { setupHttpRequestOnIpcPortResponse(); return -1; } - - if (!RpcConstants.HEADER.equals(dataLengthBuffer) - || version != CURRENT_VERSION) { + + if(!RpcConstants.HEADER.equals(dataLengthBuffer)) { + LOG.warn("Incorrect RPC Header length from {}:{} " + + "expected length: {} got length: {}", + hostAddress, remotePort, RpcConstants.HEADER, dataLengthBuffer); + setupBadVersionResponse(version); + return -1; + } + if (version != CURRENT_VERSION) { //Warning is ok since this is not supposed to happen. - LOG.warn("Incorrect header or version mismatch from " + + LOG.warn("Version mismatch from " + hostAddress + ":" + remotePort + " got version " + version + " expected version " + CURRENT_VERSION);