Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12074

in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Instead of creating IOException with message make InterruptedException the cause of IOException, so that whoever calling shell executor can make use of it.

      1. HADOOP-12074.patch
        1 kB
        Lavkesh Lahngir

        Issue Links

          Activity

          Hide
          stevel@apache.org Steve Loughran added a comment -

          Good idea.
          I'd recommend going one step further and throwing an InterruptedIOException(cause) so the caller can act on it without looking inside

          Show
          stevel@apache.org Steve Loughran added a comment - Good idea. I'd recommend going one step further and throwing an InterruptedIOException(cause) so the caller can act on it without looking inside
          Hide
          lavkesh Lavkesh Lahngir added a comment -

          Apart from default constructor InterruptedIOException has a constructor which takes string argument.
          So no way to directly do new InterruptedIOException(cause).
          we could do.

          catch(InterruptedException ie) {
                InterruptedIOException iioe = new InterruptedIOException(ie.getMessage());
                iioe.initCause(ie);
                throw iioe;
          }
          

          Or Instead of InterruptedIOException we can just throw an IOException with cause ie.

          catch(InterruptedException ie) {
          throw newIOException(ie);
          }
          

          I feel that cause should be preserved, while wrapping exceptions.

          Show
          lavkesh Lavkesh Lahngir added a comment - Apart from default constructor InterruptedIOException has a constructor which takes string argument. So no way to directly do new InterruptedIOException(cause). we could do. catch (InterruptedException ie) { InterruptedIOException iioe = new InterruptedIOException(ie.getMessage()); iioe.initCause(ie); throw iioe; } Or Instead of InterruptedIOException we can just throw an IOException with cause ie. catch (InterruptedException ie) { throw newIOException(ie); } I feel that cause should be preserved, while wrapping exceptions.
          Hide
          stevel@apache.org Steve Loughran added a comment -

          do the initCause. It's used in other places in the code to retrofit cause retention. Which is, as you node, very important

          Show
          stevel@apache.org Steve Loughran added a comment - do the initCause . It's used in other places in the code to retrofit cause retention. Which is, as you node, very important
          Hide
          hadoopqa Hadoop QA added a comment -



          -1 overall



          Vote Subsystem Runtime Comment
          0 pre-patch 16m 9s Pre-patch trunk compilation is healthy.
          +1 @author 0m 0s The patch does not contain any @author tags.
          -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
          +1 javac 7m 29s There were no new javac warning messages.
          +1 javadoc 9m 32s There were no new javadoc warning messages.
          +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
          +1 checkstyle 1m 5s There were no new checkstyle issues.
          +1 whitespace 0m 0s The patch has no lines that end in whitespace.
          +1 install 1m 37s mvn install still works.
          +1 eclipse:eclipse 0m 35s The patch built with eclipse:eclipse.
          +1 findbugs 1m 50s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
          +1 common tests 22m 57s Tests passed in hadoop-common.
              61m 40s  



          Subsystem Report/Notes
          Patch URL http://issues.apache.org/jira/secure/attachment/12738740/HADOOP-12074.patch
          Optional Tests javadoc javac unit findbugs checkstyle
          git revision trunk / 3107434
          hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/6948/artifact/patchprocess/testrun_hadoop-common.txt
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/6948/testReport/
          Java 1.7.0_55
          uname Linux asf906.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6948/console

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 16m 9s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac 7m 29s There were no new javac warning messages. +1 javadoc 9m 32s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 1m 5s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 37s mvn install still works. +1 eclipse:eclipse 0m 35s The patch built with eclipse:eclipse. +1 findbugs 1m 50s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 common tests 22m 57s Tests passed in hadoop-common.     61m 40s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12738740/HADOOP-12074.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 3107434 hadoop-common test log https://builds.apache.org/job/PreCommit-HADOOP-Build/6948/artifact/patchprocess/testrun_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/6948/testReport/ Java 1.7.0_55 uname Linux asf906.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6948/console This message was automatically generated.
          Hide
          vinayrpet Vinayakumar B added a comment -

          Patch looks good. +1

          Show
          vinayrpet Vinayakumar B added a comment - Patch looks good. +1
          Hide
          vinayrpet Vinayakumar B added a comment -

          Committed to trunk and branch-2.
          Thanks Lavkesh Lahngir.
          Thanks Steve Loughran for suggestions.

          Show
          vinayrpet Vinayakumar B added a comment - Committed to trunk and branch-2. Thanks Lavkesh Lahngir . Thanks Steve Loughran for suggestions.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #8005 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8005/)
          HADOOP-12074. in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8005 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8005/ ) HADOOP-12074 . in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #225 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/225/)
          HADOOP-12074. in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #225 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/225/ ) HADOOP-12074 . in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #955 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/955/)
          HADOOP-12074. in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de)

          • hadoop-common-project/hadoop-common/CHANGES.txt
          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #955 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/955/ ) HADOOP-12074 . in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de) hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #214 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/214/)
          HADOOP-12074. in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #214 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/214/ ) HADOOP-12074 . in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Hdfs-trunk #2153 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2153/)
          HADOOP-12074. in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #2153 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2153/ ) HADOOP-12074 . in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #223 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/223/)
          HADOOP-12074. in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #223 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/223/ ) HADOOP-12074 . in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java hadoop-common-project/hadoop-common/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #2171 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2171/)
          HADOOP-12074. in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de)

          • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
          • hadoop-common-project/hadoop-common/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2171 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2171/ ) HADOOP-12074 . in Shell.java#runCommand() rethrow InterruptedException as InterruptedIOException (Contributed by Lavkesh Lahngir) (vinayakumarb: rev 95c73d49b1bb459b626a9ac52acadb8f5fa724de) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java hadoop-common-project/hadoop-common/CHANGES.txt

            People

            • Assignee:
              lavkesh Lavkesh Lahngir
              Reporter:
              lavkesh Lavkesh Lahngir
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development