From c2fa136a3589c30d98cffa49c9dd7682c81c2002 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Mon, 27 Apr 2026 16:10:26 +0300 Subject: T8293: Add ability to set timeout for high-availability health-check Setting a timeout allows VRRP health-check scripts to run longer than the set interval. Without timeout, keepalived considers the script as failed after interval seconds. With timeout set higher than interval, the script has more time to complete before being marked as failed and transitioning VRRP to FAULT state. --- src/conf_mode/high-availability.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/conf_mode/high-availability.py b/src/conf_mode/high-availability.py index 48a7d8abc..175929547 100755 --- a/src/conf_mode/high-availability.py +++ b/src/conf_mode/high-availability.py @@ -188,6 +188,15 @@ def _validate_health_check(group, group_config): # to avoid generating useless config statements in keepalived.conf del group_config["health_check"] + if 'timeout' in group_config.get('health_check', {}): + interval = int(group_config['health_check']['interval']) + timeout = int(group_config['health_check']['timeout']) + if timeout < interval: + Warning( + f'Health check timeout ({timeout}s) is less than interval ({interval}s) ' + f'for VRRP group "{group}", script may be killed before completion' + ) + def generate(ha): if not ha or 'disable' in ha: -- cgit v1.2.3