openvidu-deployment: Media Node health watchdog: no warm-up while openvidu.service is stopped

The warm-up after an openvidu.service (re)start also applied when the service had
been stopped, so a node whose OpenVidu was stopped soon after starting was only
replaced 15 minutes after that start. The warm-up now needs the service active
(or activating); a stopped or failed service counts as unhealthy at once.
media-node-health
Piwccle 2026-10-06 17:42:46 +02:00
parent bf54f336e0
commit a2d76661b4
8 changed files with 40 additions and 10 deletions

View File

@ -2210,8 +2210,13 @@ Resources:
PREV_IDLE=$idle
}
# openvidu.service entered the active state less than WARMUP_SEC ago
# openvidu.service is running and entered the active state less than WARMUP_SEC ago
# (a stopped or failed openvidu.service is not starting: no warm-up for it)
openvidu_starting() {
case "$(systemctl show -p ActiveState --value openvidu 2>/dev/null)" in
active|activating|reloading) ;;
*) return 1 ;;
esac
since=$(systemctl show -p ActiveEnterTimestampMonotonic --value openvidu 2>/dev/null)
case "$since" in ''|0|*[!0-9]*) return 1 ;; esac
[ $(($(uptime_sec) - since / 1000000)) -lt "$WARMUP_SEC" ]

View File

@ -1105,8 +1105,13 @@ cpu_busy() {
PREV_IDLE=$idle
}
# openvidu.service entered the active state less than WARMUP_SEC ago
# openvidu.service is running and entered the active state less than WARMUP_SEC ago
# (a stopped or failed openvidu.service is not starting: no warm-up for it)
openvidu_starting() {
case "$(systemctl show -p ActiveState --value openvidu 2>/dev/null)" in
active|activating|reloading) ;;
*) return 1 ;;
esac
since=$(systemctl show -p ActiveEnterTimestampMonotonic --value openvidu 2>/dev/null)
case "$since" in ''|0|*[!0-9]*) return 1 ;; esac
[ $(($(uptime_sec) - since / 1000000)) -lt "$WARMUP_SEC" ]

File diff suppressed because one or more lines are too long

View File

@ -1466,8 +1466,13 @@ cpu_busy() {
PREV_IDLE=$idle
}
# openvidu.service entered the active state less than WARMUP_SEC ago
# openvidu.service is running and entered the active state less than WARMUP_SEC ago
# (a stopped or failed openvidu.service is not starting: no warm-up for it)
openvidu_starting() {
case "$(systemctl show -p ActiveState --value openvidu 2>/dev/null)" in
active|activating|reloading) ;;
*) return 1 ;;
esac
since=$(systemctl show -p ActiveEnterTimestampMonotonic --value openvidu 2>/dev/null)
case "$since" in ''|0|*[!0-9]*) return 1 ;; esac
[ $(($(uptime_sec) - since / 1000000)) -lt "$WARMUP_SEC" ]

View File

@ -2853,8 +2853,13 @@ Resources:
PREV_IDLE=$idle
}
# openvidu.service entered the active state less than WARMUP_SEC ago
# openvidu.service is running and entered the active state less than WARMUP_SEC ago
# (a stopped or failed openvidu.service is not starting: no warm-up for it)
openvidu_starting() {
case "$(systemctl show -p ActiveState --value openvidu 2>/dev/null)" in
active|activating|reloading) ;;
*) return 1 ;;
esac
since=$(systemctl show -p ActiveEnterTimestampMonotonic --value openvidu 2>/dev/null)
case "$since" in ''|0|*[!0-9]*) return 1 ;; esac
[ $(($(uptime_sec) - since / 1000000)) -lt "$WARMUP_SEC" ]

View File

@ -1498,8 +1498,13 @@ cpu_busy() {
PREV_IDLE=$idle
}
# openvidu.service entered the active state less than WARMUP_SEC ago
# openvidu.service is running and entered the active state less than WARMUP_SEC ago
# (a stopped or failed openvidu.service is not starting: no warm-up for it)
openvidu_starting() {
case "$(systemctl show -p ActiveState --value openvidu 2>/dev/null)" in
active|activating|reloading) ;;
*) return 1 ;;
esac
since=$(systemctl show -p ActiveEnterTimestampMonotonic --value openvidu 2>/dev/null)
case "$since" in ''|0|*[!0-9]*) return 1 ;; esac
[ $(($(uptime_sec) - since / 1000000)) -lt "$WARMUP_SEC" ]

File diff suppressed because one or more lines are too long

View File

@ -1849,8 +1849,13 @@ cpu_busy() {
PREV_IDLE=$idle
}
# openvidu.service entered the active state less than WARMUP_SEC ago
# openvidu.service is running and entered the active state less than WARMUP_SEC ago
# (a stopped or failed openvidu.service is not starting: no warm-up for it)
openvidu_starting() {
case "$(systemctl show -p ActiveState --value openvidu 2>/dev/null)" in
active|activating|reloading) ;;
*) return 1 ;;
esac
since=$(systemctl show -p ActiveEnterTimestampMonotonic --value openvidu 2>/dev/null)
case "$since" in ''|0|*[!0-9]*) return 1 ;; esac
[ $(($(uptime_sec) - since / 1000000)) -lt "$WARMUP_SEC" ]