Blame SOURCES/0594-journald-fix-accuracy-of-watchdog-timer-event.patch

17b0f1
From 5386dfa655da623cbd5ab1be6c9c66ad866fc17a Mon Sep 17 00:00:00 2001
17b0f1
From: Lennart Poettering <lennart@poettering.net>
17b0f1
Date: Thu, 12 Nov 2015 12:33:10 +0100
17b0f1
Subject: [PATCH] journald: fix accuracy of watchdog timer event
17b0f1
17b0f1
Adding 3/4th of the watchdog frequency as accuracy on top of 1/2 of the
17b0f1
watchdog frequency means we might end up at 5/4th of the frequency which
17b0f1
means we might miss the message from time to time.
17b0f1
17b0f1
Maybe fixes #1804
17b0f1
17b0f1
(cherry picked from commit 4de2402b603ea2f518f451d06f09e15aeae54fab)
17b0f1
17b0f1
Related: #1511565
17b0f1
---
17b0f1
 src/journal/journald-server.c | 2 +-
17b0f1
 1 file changed, 1 insertion(+), 1 deletion(-)
17b0f1
17b0f1
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
17b0f1
index 6e7568b60b..7c69061f47 100644
17b0f1
--- a/src/journal/journald-server.c
17b0f1
+++ b/src/journal/journald-server.c
17b0f1
@@ -1716,7 +1716,7 @@ static int server_connect_notify(Server *s) {
17b0f1
         if (sd_watchdog_enabled(false, &s->watchdog_usec) > 0) {
17b0f1
                 s->send_watchdog = true;
17b0f1
 
17b0f1
-                r = sd_event_add_time(s->event, &s->watchdog_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + s->watchdog_usec/2, s->watchdog_usec*3/4, dispatch_watchdog, s);
17b0f1
+                r = sd_event_add_time(s->event, &s->watchdog_event_source, CLOCK_MONOTONIC, now(CLOCK_MONOTONIC) + s->watchdog_usec/2, s->watchdog_usec/4, dispatch_watchdog, s);
17b0f1
                 if (r < 0)
17b0f1
                         return log_error_errno(r, "Failed to add watchdog time event: %m");
17b0f1
         }