HDFS-10508. DFSInputStream should set thread's interrupt status after catching InterruptException from sleep. Contributed by Jing Zhao.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8ea9bbce Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8ea9bbce Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8ea9bbce Branch: refs/heads/YARN-3926 Commit: 8ea9bbce2614e8eb499af73589f021ed1789e78f Parents: 1500a0a Author: Masatake Iwasaki <[email protected]> Authored: Thu Jun 9 14:52:29 2016 +0900 Committer: Masatake Iwasaki <[email protected]> Committed: Thu Jun 9 14:52:29 2016 +0900 ---------------------------------------------------------------------- .../src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8ea9bbce/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java index 7f32a56..6132f83 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java @@ -306,6 +306,7 @@ public class DFSInputStream extends FSInputStream try { Thread.sleep(waitTime); } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new InterruptedIOException( "Interrupted while getting the last block length."); } @@ -417,6 +418,7 @@ public class DFSInputStream extends FSInputStream try { Thread.sleep(500); // delay between retries. } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new InterruptedIOException( "Interrupted while getting the length."); } @@ -1063,6 +1065,7 @@ public class DFSInputStream extends FSInputStream " IOException, will wait for " + waitTime + " msec."); Thread.sleep((long)waitTime); } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new InterruptedIOException( "Interrupted while choosing DataNode for read."); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
