You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/21 14:30:15 UTC

[GitHub] [ozone] symious opened a new pull request #2066: HDDS-5006. Use Log4j to print error messages for Datanode startup

symious opened a new pull request #2066:
URL: https://github.com/apache/ozone/pull/2066


   ## What changes were proposed in this pull request?
   
   Use Log4j to print error messages for Datanode startup, instead of System.err
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5006
   
   ## How was this patch tested?
   
   The updated result is as follows, which will be much easier for the users to find the root cause of Datanode failing to start:
   <img width="889" alt="Screenshot 2021-03-21 at 10 27 13 PM" src="https://user-images.githubusercontent.com/14933944/111908629-e4011080-8a94-11eb-947c-e3b671bea1f5.png">
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ayushtkn commented on a change in pull request #2066: HDDS-5006. Use Log4j to print error messages for Datanode startup

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #2066:
URL: https://github.com/apache/ozone/pull/2066#discussion_r598889982



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
##########
@@ -587,4 +587,15 @@ public CertificateClient getCertificateClient() {
   public void setCertificateClient(CertificateClient client) {
     dnCertClient = client;
   }
+
+  @Override
+  public void printError(Throwable error) {
+    if (error.getMessage() == null || error.getMessage().length() == 0) {
+      //message could be null in case of NPE. This is unexpected so we can
+      //print out the stack trace.
+      LOG.error("Exception in HddsDatanodeService.", error);
+    } else {
+      LOG.error(error.getMessage().split("\n")[0]);

Review comment:
       Guess can keep this only for both the cases :
   ```
    LOG.error("Exception in HddsDatanodeService.", error);
   ```
   
   Sometimes having trace of the exception really helps




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] symious commented on pull request #2066: HDDS-5006. Use Log4j to print error messages for Datanode startup

Posted by GitBox <gi...@apache.org>.
symious commented on pull request #2066:
URL: https://github.com/apache/ozone/pull/2066#issuecomment-804444492


   @ayushtkn Thanks for the review, the new output is as follows.
   <img width="1019" alt="Screenshot 2021-03-23 at 6 42 57 AM" src="https://user-images.githubusercontent.com/14933944/112067518-244eb480-8ba3-11eb-94f0-1dfaa1e9ae7e.png">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #2066: HDDS-5006. Use Log4j to print error messages for Datanode startup

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #2066:
URL: https://github.com/apache/ozone/pull/2066


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org