Grace interval on restart of hbd, fix SIGHUP processing

This commit is contained in:
Andreas Wrede
2026-04-10 12:58:38 -04:00
parent 3426185383
commit 2015195112
3 changed files with 12 additions and 5 deletions
+7 -3
View File
@@ -233,11 +233,15 @@ def restore_connection_timers(hbdclass, ctx):
if state == hbdclass.Connection.UP and interval > 0:
elapsed = now - conn.lastbeat
remaining = max(1.0, (interval + grace) - elapsed)
# Give hosts one full (interval + grace) of extra time on startup
# so hosts that were silent while hbd was down are not immediately
# flagged as overdue before they have a chance to check in.
startup_grace = interval + grace
remaining = max(startup_grace, 2 * startup_grace - elapsed)
conn.reset_overdue_timer(remaining, on_overdue)
logger.debug(
"Restored UP timer %s/%s: %.0fs remaining (elapsed %.0fs)",
uname, afam, remaining, elapsed,
"Restored UP timer %s/%s: %.0fs remaining (elapsed %.0fs, startup grace %.0fs)",
uname, afam, remaining, elapsed, startup_grace,
)
restored += 1