]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journald: fix accuracy of watchdog timer event 1863/head
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Nov 2015 11:33:10 +0000 (12:33 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Nov 2015 11:33:10 +0000 (12:33 +0100)
Adding 3/4th of the watchdog frequency as accuracy on top of 1/2 of the
watchdog frequency means we might end up at 5/4th of the frequency which
means we might miss the message from time to time.

Maybe fixes #1804

src/journal/journald-server.c

index 762b81010946ec0c5c6641120ba86d8bdc524186..be913d26ef465af049f8ad2ca8971ce80fc61a23 100644 (file)
@@ -1670,7 +1670,7 @@ static int server_connect_notify(Server *s) {
         if (sd_watchdog_enabled(false, &s->watchdog_usec) > 0) {
                 s->send_watchdog = true;
 
-                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);
+                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);
                 if (r < 0)
                         return log_error_errno(r, "Failed to add watchdog time event: %m");
         }