瀏覽代碼

HADOOP-9894. Merging change rr1518421 from branch-2 to branch-2.1-beta.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1-beta@1518423 13f79535-47bb-0310-9956-ffa450edef68
Arpit Agarwal 11 年之前
父節點
當前提交
39560f9ead

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -87,6 +87,9 @@ Release 2.1.1-beta - UNRELEASED
     HADOOP-9899. Remove the debug message, added by HADOOP-8855, from
     KerberosAuthenticator.  (szetszwo)
 
+    HADOOP-9894.  Race condition in Shell leads to logged error stream handling
+    exceptions (Arpit Agarwal)
+
 Release 2.1.0-beta - 2013-08-22
 
   INCOMPATIBLE CHANGES

+ 7 - 2
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java

@@ -475,8 +475,13 @@ abstract public class Shell {
       } catch (IOException ioe) {
         LOG.warn("Error while closing the input stream", ioe);
       }
-      if (!completed.get()) {
-        errThread.interrupt();
+      try {
+        if (!completed.get()) {
+          errThread.interrupt();
+          errThread.join();
+        }
+      } catch (InterruptedException ie) {
+        LOG.warn("Interrupted while joining errThread");
       }
       try {
         errReader.close();