Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use i_info() when time jumps forward by <0.2 seconds #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/master/main.c
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@
#define FATAL_FILENAME "master-fatal.lastlog"
#define MASTER_PID_FILE_NAME "master.pid"
#define SERVICE_TIME_MOVED_BACKWARDS_MAX_THROTTLE_MSECS (60*3*1000)
#define SERVICE_TIME_MOVED_FORWARDS_MIN_WARNING_MSECS (200*1000)

struct master_delayed_error {
enum log_type type;
@@ -659,8 +660,13 @@ master_time_moved(const struct timeval *old_time,

if (diff < 0) {
diff = -diff;
i_warning("Time moved forward by %lld.%06lld seconds - adjusting timeouts.",
diff / 1000000, diff % 1000000);
if (diff < SERVICE_TIME_MOVED_FORWARDS_MIN_WARNING_MSECS) {
i_info("Time moved forward by %lld.%06lld seconds - adjusting timeouts.",
diff / 1000000, diff % 1000000);
} else {
i_warning("Time moved forward by %lld.%06lld seconds - adjusting timeouts.",
diff / 1000000, diff % 1000000);
}
return;
}
msecs = (unsigned int)(diff/1000);