Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-3400

[JDK 8] Build Failure due to unreported exceptions in RPCUtil

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • 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

      When I try compiling Hadoop with JDK 8 like this

      mvn clean package -Pdist -Dtar -DskipTests -Djavac.version=1.8
      

      I get this error:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hadoop-yarn-common: Compilation failure: Compilation failure:
      [ERROR] /Users/rkanter/dev/hadoop-common2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[101,11] unreported exception java.lang.Throwable; must be caught or declared to be thrown
      [ERROR] /Users/rkanter/dev/hadoop-common2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[104,11] unreported exception java.lang.Throwable; must be caught or declared to be thrown
      [ERROR] /Users/rkanter/dev/hadoop-common2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[107,11] unreported exception java.lang.Throwable; must be caught or declared to be thrown
      
      1. YARN-3400.patch
        2 kB
        Robert Kanter

        Issue Links

          Activity

          Hide
          rkanter Robert Kanter added a comment -

          Looks like JDK 8 doesn't like that we're throwing T extends Throwable here, because we're not declaring throws Throwable. The patch fixes this by wrapping the calls to instantiateException with methods that return more specific subclasses of Throwable that are declared to be thrown. This allows us not to have to declare additional thrown types. And I couldn't replace Throwable with something more specific (Exception would probably work, but doesn't really get us anything) because YarnException, IOException, and RuntimeException don't have a more specific common parent.

          Show
          rkanter Robert Kanter added a comment - Looks like JDK 8 doesn't like that we're throwing T extends Throwable here, because we're not declaring throws Throwable . The patch fixes this by wrapping the calls to instantiateException with methods that return more specific subclasses of Throwable that are declared to be thrown. This allows us not to have to declare additional thrown types. And I couldn't replace Throwable with something more specific ( Exception would probably work, but doesn't really get us anything) because YarnException , IOException , and RuntimeException don't have a more specific common parent.
          Hide
          rkanter Robert Kanter added a comment -

          I was successfully able to compile with JDK 7 and JDK 8.

          Show
          rkanter Robert Kanter added a comment - I was successfully able to compile with JDK 7 and JDK 8.
          Hide
          hadoopqa Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12707392/YARN-3400.patch
          against trunk revision 44809b8.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. 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. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common.

          Test results: https://builds.apache.org/job/PreCommit-YARN-Build/7111//testReport/
          Console output: https://builds.apache.org/job/PreCommit-YARN-Build/7111//console

          This message is automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12707392/YARN-3400.patch against trunk revision 44809b8. +1 @author . The patch does not contain any @author tags. -1 tests included . 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 . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common. Test results: https://builds.apache.org/job/PreCommit-YARN-Build/7111//testReport/ Console output: https://builds.apache.org/job/PreCommit-YARN-Build/7111//console This message is automatically generated.
          Hide
          stevel@apache.org Steve Loughran added a comment -

          I'd seen this too. Given that jenkins is happy with it, and you can replicate with the javac version updated:

          +1

          Show
          stevel@apache.org Steve Loughran added a comment - I'd seen this too. Given that jenkins is happy with it, and you can replicate with the javac version updated: +1
          Hide
          rkanter Robert Kanter added a comment -

          Thanks for the review Steve. Committed to trunk and branch-2!

          Show
          rkanter Robert Kanter added a comment - Thanks for the review Steve. Committed to trunk and branch-2!
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #7441 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7441/)
          YARN-3400. [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798)

          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #7441 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7441/ ) YARN-3400 . [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #145 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/145/)
          YARN-3400. [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          • hadoop-yarn-project/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #145 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/145/ ) YARN-3400 . [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java hadoop-yarn-project/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #879 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/879/)
          YARN-3400. [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798)

          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #879 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/879/ ) YARN-3400 . [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #145 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/145/)
          YARN-3400. [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          • hadoop-yarn-project/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #145 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/145/ ) YARN-3400 . [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java hadoop-yarn-project/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #2095 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2095/)
          YARN-3400. [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          • hadoop-yarn-project/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2095 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2095/ ) YARN-3400 . [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java hadoop-yarn-project/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Hdfs-trunk #2077 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2077/)
          YARN-3400. [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798)

          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #2077 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2077/ ) YARN-3400 . [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Hdfs-trunk-Java8 #136 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/136/)
          YARN-3400. [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java
          • hadoop-yarn-project/CHANGES.txt
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk-Java8 #136 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/136/ ) YARN-3400 . [JDK 8] Build Failure due to unreported exceptions in RPCUtil (rkanter) (rkanter: rev 87130bf6b22f538c5c26ad5cef984558a8117798) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java hadoop-yarn-project/CHANGES.txt

            People

            • Assignee:
              rkanter Robert Kanter
              Reporter:
              rkanter Robert Kanter
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development