From c36fbcbf1711d01f2b586795b52b47b112c51612 Mon Sep 17 00:00:00 2001 From: sunlisheng Date: Wed, 8 Jan 2020 10:20:36 +0800 Subject: [PATCH] Remove WARN log when ipc connection interrupted in Client#handleSaslConnectionFailure() Signed-off-by: sunlisheng (cherry picked from commit d887e49dd4ed2b94bbb53b7608586f5da6cee037) --- .../src/main/java/org/apache/hadoop/ipc/Client.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java index 32e71a0938e..3be5707fdb2 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java @@ -761,8 +761,17 @@ public class Client implements AutoCloseable { throw (IOException) new IOException(msg).initCause(ex); } } else { - LOG.warn("Exception encountered while connecting to " - + "the server : " + ex); + // With RequestHedgingProxyProvider, one rpc call will send multiple + // requests to all namenodes. After one request return successfully, + // all other requests will be interrupted. It's not a big problem, + // and should not print a warning log. + if (ex instanceof InterruptedIOException) { + LOG.debug("Exception encountered while connecting to the server", + ex); + } else { + LOG.warn("Exception encountered while connecting to the server ", + ex); + } } if (ex instanceof RemoteException) throw (RemoteException) ex;