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

(cherry picked from commit 3a52bfc5db)
This commit is contained in:
Viraj Jasani 2021-07-23 10:08:55 +05:30 committed by Hui Fei
parent 1b1b3ceddc
commit 1df581a20c
1 changed files with 7 additions and 1 deletions

View File

@ -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();
}
}
}