]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/manager: do not exclude watchdog logic from busy-loop protection 35708/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Mar 2025 14:06:28 +0000 (15:06 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Mar 2025 09:45:49 +0000 (10:45 +0100)
As reported in https://github.com/systemd/systemd/issues/35405, if the watchdog
ping failed, we effectively started a busy loop here. The previous commits
should fix this, but in general, the protection here is intended as a safety
net in case the logic is broken somewhere else. We shouldn't exclude the
watchdog stuff from this.

src/core/manager.c

index 45f3464dd443e1275ab79148743d952c0f7edd20..afccb48d7edda30fcc3f132f8faad5acde8631ac 100644 (file)
@@ -3352,14 +3352,14 @@ int manager_loop(Manager *m) {
 
         while (m->objective == MANAGER_OK) {
 
-                (void) watchdog_ping();
-
                 if (!ratelimit_below(&rl)) {
                         /* Yay, something is going seriously wrong, pause a little */
                         log_warning("Looping too fast. Throttling execution a little.");
                         sleep(1);
                 }
 
+                (void) watchdog_ping();
+
                 if (manager_dispatch_load_queue(m) > 0)
                         continue;