You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/01/28 17:04:23 UTC

[GitHub] [helix] NealSun96 commented on a change in pull request #1949: Fix for - Stale message redundant logs #1940

NealSun96 commented on a change in pull request #1949:
URL: https://github.com/apache/helix/pull/1949#discussion_r794691589



##########
File path: helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
##########
@@ -53,6 +52,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+

Review comment:
       @desaikomal It occurred to me that you might not be using helix-style-intellij.xml to format the code. It's a requirement for Helix PRs, and you can find guidelines here: https://github.com/apache/helix/wiki/Helix-Code-Style-in-Intellij-IDE :) 

##########
File path: helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
##########
@@ -200,11 +200,17 @@ private void generateMessage(final Resource resource, final BaseControllerDataPr
         }
 
         for (Message staleMessage : staleMessages) {
-          if (System.currentTimeMillis() - currentStateOutput
+          if ((System.currentTimeMillis() - currentStateOutput
               .getEndTime(resourceName, partition, instanceName)
-              > DEFAULT_OBSELETE_MSG_PURGE_DELAY) {
-            logAndAddToCleanUp(messagesToCleanUp, staleMessage, instanceName, resourceName,
-                partition, currentState, STALE_MESSAGE);
+              > DEFAULT_OBSELETE_MSG_PURGE_DELAY)
+              && staleMessage.getResourceName().equals(resourceName)) {
+              // staleMessage can be simple or batch mode
+              if ((staleMessage.getPartitionName().equals(partition.getPartitionName()))
+                 || (staleMessage.getBatchMessageMode()
+                     && staleMessage.getPartitionNames().contains(partition.getPartitionName()))) {

Review comment:
       Could you please combine the two if conditions into one? 




-- 
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: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org