diff mbox series

[3/3] libmultipath: cut watchdog interval in half

Message ID 20241114144224.248606-4-mwilck@suse.com (mailing list archive)
State New
Headers show
Series multipath-tools: fixes for systemd watchdog | expand

Commit Message

Martin Wilck Nov. 14, 2024, 2:42 p.m. UTC
According to [1], a daemon should trigger the watchdog every half of the time
that is communicated via WATCHDOG_USEC.

[1] https://www.freedesktop.org/software/systemd/man/latest/sd_watchdog_enabled.html

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/config.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libmultipath/config.c b/libmultipath/config.c
index bd199fa..4d457b8 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -877,8 +877,11 @@  static void set_max_checkint_from_watchdog(struct config *conf)
 		if (checkint == 0)
 			/* watchdog disabled */
 			return;
-		/* Value is in microseconds */
-		checkint /= 1000000;
+		/*
+		 * Value is in microseconds, and we should trigger the watchdog
+		 * twice per interval.
+		 */
+		checkint /= 2000000;
 		if (checkint < 1 || checkint > UINT_MAX) {
 			condlog(1, "invalid value for WatchdogSec: \"%s\"", envp);
 			return;