浏览代码

HADOOP-17808. ipc.Client to set interrupt flag after catching InterruptedException (#3219)

(cherry picked from commit 3a52bfc5db1b13a71d5a5c6ee0cd689fb8b27895)
Viraj Jasani 3 年之前
父节点
当前提交
5ea1337167
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

+ 7 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

@@ -1051,7 +1051,10 @@ public class Client implements AutoCloseable {
         if (timeout>0) {
           try {
             wait(timeout);
-          } catch (InterruptedException e) {}
+          } catch (InterruptedException e) {
+            LOG.info("Interrupted while waiting to retrieve RPC response.", e);
+            Thread.currentThread().interrupt();
+          }
         }
       }
       
@@ -1383,6 +1386,9 @@ public class Client implements AutoCloseable {
         try {
           emptyCondition.wait();
         } catch (InterruptedException e) {
+          LOG.info("Interrupted while waiting on all connections to be closed.",
+              e);
+          Thread.currentThread().interrupt();
         }
       }
     }