HDFS-10508. DFSInputStream should set thread's interrupt status after catching InterruptException from sleep. Contributed by Jing Zhao.
This commit is contained in:
parent
1500a0a300
commit
8ea9bbce26
@ -306,6 +306,7 @@ private void waitFor(int waitTime) throws IOException {
|
|||||||
try {
|
try {
|
||||||
Thread.sleep(waitTime);
|
Thread.sleep(waitTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
throw new InterruptedIOException(
|
throw new InterruptedIOException(
|
||||||
"Interrupted while getting the last block length.");
|
"Interrupted while getting the last block length.");
|
||||||
}
|
}
|
||||||
@ -417,6 +418,7 @@ private long readBlockLength(LocatedBlock locatedblock) throws IOException {
|
|||||||
try {
|
try {
|
||||||
Thread.sleep(500); // delay between retries.
|
Thread.sleep(500); // delay between retries.
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
throw new InterruptedIOException(
|
throw new InterruptedIOException(
|
||||||
"Interrupted while getting the length.");
|
"Interrupted while getting the length.");
|
||||||
}
|
}
|
||||||
@ -1063,6 +1065,7 @@ private DNAddrPair chooseDataNode(LocatedBlock block,
|
|||||||
" IOException, will wait for " + waitTime + " msec.");
|
" IOException, will wait for " + waitTime + " msec.");
|
||||||
Thread.sleep((long)waitTime);
|
Thread.sleep((long)waitTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
throw new InterruptedIOException(
|
throw new InterruptedIOException(
|
||||||
"Interrupted while choosing DataNode for read.");
|
"Interrupted while choosing DataNode for read.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user