浏览代码

Remove WARN log when ipc connection interrupted in Client#handleSaslConnectionFailure()

Signed-off-by: sunlisheng <sunlisheng@xiaomi.com>
(cherry picked from commit d887e49dd4ed2b94bbb53b7608586f5da6cee037)
sunlisheng 5 年之前
父节点
当前提交
55139ee194
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

+ 11 - 2
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

@@ -763,8 +763,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;