You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/11/05 14:42:31 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #3067: Reduce logging when external compactions are cancelled

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


##########
server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java:
##########
@@ -392,7 +395,10 @@ private void compactLocalityGroup(String lgName, Set<ByteSequence> columnFamilie
             try {
               mfw.close();
             } catch (IOException e) {
-              log.error("{}", e.getMessage(), e);
+              log.error("{}", e.getMessage());
+              if (log.isDebugEnabled()) {
+                log.debug(e.getMessage(), e);

Review Comment:
   ```suggestion
                   log.debug("{}", e.getMessage(), e);
   ```



##########
server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java:
##########
@@ -578,6 +578,8 @@ protected Runnable createCompactionJob(final TExternalCompactionJob job,
         TCompactionStatusUpdate update2 = new TCompactionStatusUpdate(TCompactionState.SUCCEEDED,
             "Compaction completed successfully", -1, -1, -1);
         updateCompactionState(job, update2);
+      } catch (FileCompactor.CompactionCanceledException cce) {
+        LOG.debug("Compaction canceled {} ", job.getExternalCompactionId());

Review Comment:
   ```suggestion
           LOG.debug("Compaction canceled {}", job.getExternalCompactionId());
   ```



##########
server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java:
##########
@@ -280,7 +280,10 @@ public CompactionStats call() throws IOException, CompactionCanceledException {
           }
         }
       } catch (IOException | RuntimeException e) {
-        log.warn("{}", e.getMessage(), e);
+        log.warn("{}", e.getMessage());
+        if (log.isDebugEnabled()) {
+          log.debug(e.getMessage(), e);

Review Comment:
   This is a safer version, in case there's any braces in the message that could be misinterpreted as a string interpolation.
   
   ```suggestion
             log.debug("{}", e.getMessage(), 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