fix: never park the last present family as absent

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uc9V1v7iXruubpoLiSE24M
This commit is contained in:
2026-09-21 09:50:43 -04:00
co-authored by Claude Sonnet 5
parent 8122c8d7dc
commit 95355374f8
5 changed files with 72 additions and 3 deletions
+7 -1
View File
@@ -249,7 +249,11 @@ def _make_timer_callbacks(uname, host, ctx):
return
now = time.time()
afam = connection.afam
if not host.flag_present(afam):
# Park only while some other family is still present: the last monitored family
# must never be parked silently, or a host whose client reports no internet on any
# protocol would die without an alert.
if not host.flag_present(afam) and any(
af != afam and host.family_present(af) for af in host.connections):
# The client says this protocol has no connectivity: not an outage.
connection.newstate(cls.ABSENT, now)
connection.cancel_overdue_timer()
@@ -258,6 +262,8 @@ def _make_timer_callbacks(uname, host, ctx):
msg_to_websockets("host", host.stateinfo())
return
# If any connection is DOWN (clean shutdown reported) Host.status() is "down", so a
# later overdue of the other family raises no separate event/alert; the shutdown did.
prev = host.status()
connection.newstate(cls.OVERDUE, now, cfg.get("grace", 2))
new = host.status()