From 5ea1337167ba3a927e6a6fae61b67f31eb604765 Mon Sep 17 00:00:00 2001 From: Viraj Jasani Date: Fri, 23 Jul 2021 10:08:55 +0530 Subject: [PATCH] HADOOP-17808. ipc.Client to set interrupt flag after catching InterruptedException (#3219) (cherry picked from commit 3a52bfc5db1b13a71d5a5c6ee0cd689fb8b27895) --- .../src/main/java/org/apache/hadoop/ipc/Client.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 4a0b5aec40..0ea1c22741 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 @@ -1051,7 +1051,10 @@ private synchronized boolean waitForWork() { 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 void stop() { try { emptyCondition.wait(); } catch (InterruptedException e) { + LOG.info("Interrupted while waiting on all connections to be closed.", + e); + Thread.currentThread().interrupt(); } } }