From 4d51318a40a1ee365e4d06bbc0c2b1c201b2febc Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 15 Sep 2023 16:54:51 -0400 Subject: [PATCH] Make monitoring interval configurable --- node-daemon/pvcnoded.sample.yaml | 2 ++ node-daemon/pvcnoded/objects/MonitoringInstance.py | 2 +- node-daemon/pvcnoded/util/config.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/node-daemon/pvcnoded.sample.yaml b/node-daemon/pvcnoded.sample.yaml index 0fd93981..01e5c978 100644 --- a/node-daemon/pvcnoded.sample.yaml +++ b/node-daemon/pvcnoded.sample.yaml @@ -100,6 +100,8 @@ pvc: vm_shutdown_timeout: 180 # keepalive_interval: Number of seconds between keepalive/status updates keepalive_interval: 5 + # monitoring_interval: Number of seconds between monitoring check updates + monitoring_interval: 60 # fence_intervals: Number of keepalive_intervals to declare a node dead and fence it fence_intervals: 6 # suicide_intervals: Numer of keepalive_intervals before a node considers itself dead and self-fences, 0 to disable diff --git a/node-daemon/pvcnoded/objects/MonitoringInstance.py b/node-daemon/pvcnoded/objects/MonitoringInstance.py index ae348672..46c9f216 100644 --- a/node-daemon/pvcnoded/objects/MonitoringInstance.py +++ b/node-daemon/pvcnoded/objects/MonitoringInstance.py @@ -345,7 +345,7 @@ class MonitoringInstance(object): self.run_cleanups() def start_check_timer(self): - check_interval = 60 + check_interval = self.config["monitoring_interval"] self.logger.out( f"Starting monitoring check timer ({check_interval} second interval)", state="s", diff --git a/node-daemon/pvcnoded/util/config.py b/node-daemon/pvcnoded/util/config.py index e74277a7..0c3fcb8b 100644 --- a/node-daemon/pvcnoded/util/config.py +++ b/node-daemon/pvcnoded/util/config.py @@ -246,6 +246,7 @@ def get_configuration(): config_intervals = { "vm_shutdown_timeout": int(o_intervals.get("vm_shutdown_timeout", 60)), "keepalive_interval": int(o_intervals.get("keepalive_interval", 5)), + "monitoring_interval": int(o_intervals.get("monitoring_interval", 60)), "fence_intervals": int(o_intervals.get("fence_intervals", 6)), "suicide_intervals": int(o_intervals.get("suicide_interval", 0)), }