HDFS-14451. Incorrect header or version mismatch log message. Contributed by Shweta.

Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
(cherry picked from commit 93d7630062)
(cherry picked from commit 7a5d9ab9ee)
This commit is contained in:
Shweta 2019-05-24 18:41:45 +02:00 committed by Wei-Chiu Chuang
parent 6690955358
commit a6ff20d25d
1 changed files with 10 additions and 4 deletions

View File

@ -2067,10 +2067,16 @@ public abstract class Server {
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);