[ 
https://issues.apache.org/jira/browse/HDFS-16702?focusedWorklogId=797417&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-797417
 ]

ASF GitHub Bot logged work on HDFS-16702:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Aug/22 22:02
            Start Date: 02/Aug/22 22:02
    Worklog Time Spent: 10m 
      Work Description: virajjasani commented on code in PR #4671:
URL: https://github.com/apache/hadoop/pull/4671#discussion_r936061077


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java:
##########
@@ -94,7 +94,12 @@ public String toString() {
       if (message == null) {
         message = super.toString();
       }
-      return Integer.toString(status) + ": " + message;
+      String finalString = status + ": " + message;
+      Throwable cause = getCause();
+      if (cause != null) {
+        finalString = finalString + " : \n" + "cause: " + cause.getMessage();
+      }
+      return finalString;

Review Comment:
   > 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?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 797417)
    Time Spent: 1h 10m  (was: 1h)

> MiniDFSCluster should report cause of exception in assertion error
> ------------------------------------------------------------------
>
>                 Key: HDFS-16702
>                 URL: https://issues.apache.org/jira/browse/HDFS-16702
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs
>         Environment: Tests running in the Hadoop dev environment image.
>            Reporter: Steve Vaughan
>            Assignee: Viraj Jasani
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> When the MiniDFSClsuter detects that an exception caused an exit, it should 
> include that exception as the cause for the AssertionError that it throws.  
> The current AssertError simply reports the message "Test resulted in an 
> unexpected exit" and provides a stack trace to the location of the check for 
> an exit exception.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to