You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/12/14 03:01:45 UTC

[GitHub] [hadoop] ChengbingLiu commented on a diff in pull request #5215: HADOOP-18567. LogThrottlingHelper: the dependent recorder is not triggered correctly

ChengbingLiu commented on code in PR #5215:
URL: https://github.com/apache/hadoop/pull/5215#discussion_r1047964506


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/log/LogThrottlingHelper.java:
##########
@@ -262,8 +263,15 @@ public LogAction record(String recorderName, long currentTimeMs,
     if (primaryRecorderName.equals(recorderName) &&
         currentTimeMs - minLogPeriodMs >= lastLogTimestampMs) {
       lastLogTimestampMs = currentTimeMs;
-      for (LoggingAction log : currentLogs.values()) {
-        log.setShouldLog();
+      for (Iterator<LoggingAction> it = currentLogs.values().iterator(); it
+          .hasNext();) {
+        LoggingAction log = it.next();
+        if (log.hasLogged()) {
+          // Make sure the dependent recorders will be triggered the next time
+          it.remove();
+        } else {
+          log.setShouldLog();
+        }
       }

Review Comment:
   Makes sense. Added a new commit according to your suggestions.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

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


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