-
fix(hosts): remote machines showed the viewing node's process uptime — keep a known boot_time, never let a writer zero it
Release / version (push) Canceled after 0sRelease / frontend (push) Canceled after 0sRelease / linux (amd64) (push) Canceled after 0sRelease / linux (arm64) (push) Canceled after 0sRelease / windows (push) Canceled after 0sRelease / macos (push) Canceled after 0sRelease / release (push) Canceled after 0sBuild and Push Docker Image / build-and-push (push) Canceled after 0sreleased this
2026-09-09 11:38:37 +03:00 | 63 commits to main since this releaseAfter
2a17dfcevery remote card (on the hub and inside a cluster) showed the same
uptime — 12h30m, 11h53m — while only the node's own row was right.Root cause: Replicator.BackfillLocalHosts rebuilt HostInfo from table rows without
BootTime. It runs on Raft activation and every 10 minutes from the bridge sender's
push-mode reconcile, so each run replicated CmdHostUpsert/CmdConnectorHostUpsert with
boot_time=0 and overwrote every remote row on peers and on the hub. /health then fell
back to THIS server's process uptime, printing one number on every remote card. The
bug is old, but until2a17dfccached gopsutil's boot time the agent's fingerprint
wobbled every tick (now − uptime from whole-second clocks) and re-sent the real value
within seconds; with a stable value the heartbeat became truly 10-min and the zeroed
state persisted about half the time.- BackfillLocalHosts carries the row's BootTime.
- hosts.StableBootTime in every upsert branch (local / agent ×2 / connector): 0 means
"unknown" and keeps the stored value; a difference within ±2 s is truncation noise
and keeps the stored value; anything else is a real reboot and lands. - The Proxmox and PBS pollers apply it before fingerprinting, so the ±1 s wobble of
now − uptime no longer costs a Raft round per poll. - /health?host_id= returns an empty uptime when the boot time is unknown (the card
hides the clock) — never the process uptime; host-less /health keeps it.
Verified: full go test ./... green (new regression tests for the backfill payload,
the four repository branches, the poller path and the health fallback); native binary
on a fresh SQLite reports host 1's uptime from the OS boot time (matches
sysctl kern.boottime exactly) and 1s process uptime for host-less /health.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com
Downloads