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/20 23:44:36 UTC

[GitHub] [hadoop] xkrogen commented on a diff in pull request #5246: HDFS-16872. Fix log throttling by declaring LogThrottlingHelper as static members

xkrogen commented on code in PR #5246:
URL: https://github.com/apache/hadoop/pull/5246#discussion_r1053850133


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/log/LogThrottlingHelper.java:
##########
@@ -259,6 +259,10 @@ public LogAction record(String recorderName, long currentTimeMs,
       currentLogs.put(recorderName, currentLog);
     }
     currentLog.recordValues(values);
+    if (currentTimeMs < lastLogTimestampMs) {
+      // Reset lastLogTimestampMs: this should only happen in tests
+      lastLogTimestampMs = Long.MIN_VALUE;
+    }

Review Comment:
   This is a bit awkward. How about instead we add a new method like `reset()` that clears all of the state?



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