You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ctubbsii (via GitHub)" <gi...@apache.org> on 2023/05/13 02:42:19 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #3398: Include missing stack trace when logging error

ctubbsii commented on code in PR #3398:
URL: https://github.com/apache/accumulo/pull/3398#discussion_r1192904064


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -984,7 +984,7 @@ synchronized void completeClose(boolean saveState, boolean completeClose) throws
             activeScans.size());
         this.wait(50);
       } catch (InterruptedException e) {
-        log.error(e.toString());
+        log.error("Interrupted waiting to completeClose for extent {}, {}", extent, e, e);

Review Comment:
   With a custom message, it's no longer necessary to force the exception.toString to be part of the message. That's mostly a hack to satisfy the logging API when you don't have a custom message to satisfy the API's need for a string as the first parameter. Having the stack trace is sufficient, as it will already display the message.
   
   ```suggestion
           log.error("Interrupted waiting to completeClose for extent {}", extent, e);
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

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