Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDFS-16702. MiniDFSCluster should report cause of exception in assertion error #4671

Closed
wants to merge 3 commits into from

Conversation

virajjasani
Copy link
Contributor

Description of PR

  • MiniDFSCluster should report cause of exception in assertion error
  • Improve message of ExitException to include cause

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 46s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 15m 18s Maven dependency ordering for branch
+1 💚 mvninstall 25m 33s trunk passed
+1 💚 compile 23m 25s trunk passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 compile 23m 16s trunk passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 checkstyle 3m 55s trunk passed
+1 💚 mvnsite 3m 26s trunk passed
+1 💚 javadoc 2m 18s trunk passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 javadoc 2m 27s trunk passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 spotbugs 6m 7s trunk passed
+1 💚 shadedclient 24m 29s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 30s Maven dependency ordering for patch
+1 💚 mvninstall 2m 18s the patch passed
+1 💚 compile 24m 19s the patch passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 javac 24m 19s the patch passed
+1 💚 compile 21m 55s the patch passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 javac 21m 55s the patch passed
+1 💚 blanks 0m 1s The patch has no blanks issues.
+1 💚 checkstyle 3m 36s the patch passed
+1 💚 mvnsite 3m 20s the patch passed
+1 💚 javadoc 2m 9s the patch passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 javadoc 2m 22s the patch passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 spotbugs 6m 26s the patch passed
+1 💚 shadedclient 23m 34s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 18m 37s hadoop-common in the patch passed.
+1 💚 unit 245m 34s hadoop-hdfs in the patch passed.
+1 💚 asflicense 1m 17s The patch does not generate ASF License warnings.
486m 33s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4671/1/artifact/out/Dockerfile
GITHUB PR #4671
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux a39be1242bf9 4.15.0-169-generic #177-Ubuntu SMP Thu Feb 3 10:50:38 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 00eacc4
Default Java Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4671/1/testReport/
Max. process+thread count 3775 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4671/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@virajjasani
Copy link
Contributor Author

@ayushtkn @snmvaughan could you please review this PR?

Comment on lines 97 to 102
return Integer.toString(status) + ": " + message;
String finalString = status + ": " + message;
Throwable cause = getCause();
if (cause != null) {
finalString = finalString + " : \n" + "cause: " + cause.getMessage();
}
return finalString;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we changing the response string, I am not sure about the compatibility here.
The above javadoc says

String value does not include exception type, just exit code and message.

We shouldn't make prod level API changes for MiniDFSCluster

Copy link
Contributor Author

@virajjasani virajjasani Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just exit code and message

In a way, we are just improving the message by also including cause message if any cause is associated. I just thought it would be good improvement. We are still not including exception type even with this patch as the Javadoc claims. Only if we print the cause itself, then we would have included exception type. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if you still think we should not include cause.getMessage() in addition to this.getMessage(), I can remove it. It's just that we would be able to include one more layer of message to the existing message if we can include cause.getMessage() as well, just a minor improvement.

@snmvaughan
Copy link
Contributor

The original identified problem wasn't about the message of the thrown error, but the lack of a stack trace as part of that exception.

@snmvaughan
Copy link
Contributor

snmvaughan commented Aug 3, 2022

     LOG.info("Shutting down the Mini HDFS Cluster");
     if (checkExitOnShutdown)  {
       if (ExitUtil.terminateCalled()) {
-        LOG.error("Test resulted in an unexpected exit",
-            ExitUtil.getFirstExitException());
+        Exception cause = ExitUtil.getFirstExitException();
+        LOG.error("Test resulted in an unexpected exit", cause);
         ExitUtil.resetFirstExitException();
-        throw new AssertionError("Test resulted in an unexpected exit");
+        throw new AssertionError("Test resulted in an unexpected exit", cause);
       }
     }
     if (closeFileSystem) {

@virajjasani
Copy link
Contributor Author

I understand, but I would like to know if improving the toString() is useful. If no, I will remove it from this PR. If yes, and if it should be done separately, we can do that as well.

@ayushtkn @snmvaughan thoughts?

@snmvaughan
Copy link
Contributor

The updated message looks like it could be useful.

@ayushtkn
Copy link
Member

ayushtkn commented Aug 3, 2022

This message change and stuff I doubt can land up with compatibility issues if some downstream or so is asserting the string output and then this will lead to too much of noise.
No doubt the change to the toString() is good, but better separate it in another Jira, and we can think more about that there..

@virajjasani
Copy link
Contributor Author

Sounds reasonable @ayushtkn. Updated the PR.

@ayushtkn
Copy link
Member

ayushtkn commented Aug 3, 2022

Hmm, there are two PR now linked to the Jira and both to trunk? @snmvaughan / @virajjasani
Both seems identical, can you folks figure out

@virajjasani
Copy link
Contributor Author

Hmm, there are two PR now linked to the Jira and both to trunk?

Ah, didn't realize that. @snmvaughan you can get your PR merged if you would like, I just felt taking this up only because the Jira was not assigned to you by the time I raised PR, but anything is fine. All upto you :)

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 10s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 15m 47s Maven dependency ordering for branch
+1 💚 mvninstall 28m 33s trunk passed
+1 💚 compile 25m 28s trunk passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 compile 22m 9s trunk passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 checkstyle 4m 32s trunk passed
+1 💚 mvnsite 4m 5s trunk passed
+1 💚 javadoc 3m 4s trunk passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 javadoc 3m 7s trunk passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 spotbugs 7m 2s trunk passed
+1 💚 shadedclient 27m 18s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 25s Maven dependency ordering for patch
+1 💚 mvninstall 2m 28s the patch passed
+1 💚 compile 24m 43s the patch passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 javac 24m 43s the patch passed
+1 💚 compile 22m 42s the patch passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 javac 22m 42s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 4m 37s the patch passed
+1 💚 mvnsite 4m 23s the patch passed
+1 💚 javadoc 2m 59s the patch passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1
+1 💚 javadoc 3m 13s the patch passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
+1 💚 spotbugs 7m 19s the patch passed
+1 💚 shadedclient 28m 28s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 20m 44s hadoop-common in the patch passed.
-1 ❌ unit 396m 41s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch passed.
+1 💚 asflicense 1m 34s The patch does not generate ASF License warnings.
662m 19s
Reason Tests
Failed junit tests hadoop.hdfs.server.namenode.ha.TestSeveralNameNodes
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4671/2/artifact/out/Dockerfile
GITHUB PR #4671
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux a2c2eaa1f5f5 4.15.0-175-generic #184-Ubuntu SMP Thu Mar 24 17:48:36 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 48302ed
Default Java Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Private Build-11.0.15+10-Ubuntu-0ubuntu0.20.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4671/2/testReport/
Max. process+thread count 1981 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4671/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@virajjasani virajjasani closed this Aug 5, 2022
@virajjasani virajjasani deleted the HDFS-16702-trunk branch August 5, 2022 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants