gemmellr commented on code in PR #4479:
URL: https://github.com/apache/activemq-artemis/pull/4479#discussion_r1195475276


##########
artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java:
##########
@@ -3267,20 +3279,30 @@ void scheduleReclaim() {
          return;
       }
 
+      if (logger.isDebugEnabled()) {
+         logger.debug("JournalImpl::scheduleReclamin, autoReclaim={}, 
compactorRunning={}", isAutoReclaim(), compactorRunning.get());
+      }
+
       if (isAutoReclaim() && !compactorRunning.get()) {
+         logger.trace("Scheduling reclaim and compactor checks");
          compactorExecutor.execute(new Runnable() {
             @Override
             public void run() {
                try {
                   processBackup();
-                  if (!checkReclaimStatus()) {
-                     checkCompact();
-                  }
+                  checkReclaimStatus();
+                  checkCompact();
                } catch (Exception e) {
                   ActiveMQJournalLogger.LOGGER.errorSchedulingCompacting(e);
+               } finally {
+                  logger.debug("JournalImpl::scheduleReclaim finished");
                }
             }
          });
+      } else {
+         if (logger.isTraceEnabled()) {
+            logger.trace("Ignoring compactorExecutor call because of 
autoReclaim={} and compactorRunning={}", isAutoReclaim(), 
compactorRunning.get());

Review Comment:
   These values on the other hand, seem like they could actually change between 
first inspection in the if and later being logged, when the values are 
retrieved again.
   
   If getting accurate info on these is important, would need to assigning the 
values so the logging reflects the values used for the decision.
   
   If not, would maybe be worth tweaking the log message (e.g dropping 'because 
of', add some brackets, say 'current') to make it clearer the values logged are 
current and actually separate from the earlier decision.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to