This is an automated email from the ASF dual-hosted git repository.
BiteTheDDDDt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 2a94cd8e085 [fix](be) Limit backward clock warning logs (#63620)
2a94cd8e085 is described below
commit 2a94cd8e0853904b774c81db0abc1f32593b6139
Author: Pxl <[email protected]>
AuthorDate: Wed May 27 09:49:12 2026 +0800
[fix](be) Limit backward clock warning logs (#63620)
Problem Summary: Reduce repeated stopwatch warnings when CLOCK_MONOTONIC
appears to move backwards by rate-limiting the log output and using
warning severity directly.
---
be/src/util/stopwatch.hpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/be/src/util/stopwatch.hpp b/be/src/util/stopwatch.hpp
index 700f32f1f92..e44a4deb028 100644
--- a/be/src/util/stopwatch.hpp
+++ b/be/src/util/stopwatch.hpp
@@ -20,6 +20,7 @@
#pragma once
+#include <glog/logging.h>
#include <time.h>
#include <ctime>
@@ -89,7 +90,8 @@ public:
auto start_nanos = _start.tv_sec * NANOS_PER_SEC + _start.tv_nsec;
auto end_nanos = end.tv_sec * NANOS_PER_SEC + end.tv_nsec;
if (end_nanos < start_nanos) {
- LOG(INFO) << "WARNING: time went backwards from " << start_nanos
<< " to " << end_nanos;
+ LOG_EVERY_T(WARNING, 1)
+ << "time went backwards from " << start_nanos << " to " <<
end_nanos;
return 0;
}
return end_nanos - start_nanos;
@@ -110,7 +112,8 @@ public:
if (end.tv_sec < _start.tv_sec) {
auto start_nanos = _start.tv_sec * NANOS_PER_SEC + _start.tv_nsec;
auto end_nanos = end.tv_sec * NANOS_PER_SEC + end.tv_nsec;
- LOG(INFO) << "WARNING: time went backwards from " << start_nanos
<< " to " << end_nanos;
+ LOG_EVERY_T(WARNING, 1)
+ << "time went backwards from " << start_nanos << " to " <<
end_nanos;
return 0;
}
return end.tv_sec - _start.tv_sec;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]