Cluster: drop the old node lease after a server is renamed #460

Merged
jcoffey-dev merged 1 commits from fix/458-renamed-node-lease into main 2026-11-18 20:55:59 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 281f3ce771 Cluster: drop the old node lease after a server is renamed
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 12m6s
Renaming a server left its old node behind on the dashboard as "not
responding" for a day. The lease is keyed by hostname, and the installer
sets the container's hostname to the mail host, so a rename restarted the
server under a new lease while the old one sat there until it went
inactive 24 hours later. It can't be deleted from the console.

Each node now keeps the name it last leased under in node-hostname, next
to its local config (/etc/inbuxa, a volume in the installer's compose
file). When the name has changed, the per-minute lease renewal releases
the old name's lease once it has missed two renewals, before the
dashboard would call it stale. Only a lease last renewed before this node
started counts, so a host still running under that name (two nodes
sharing a config directory, say) keeps its lease and still shows up when
it stops. A read-only config directory just means the 24-hour expiry, as
before.

Leases left by a rename before this release still expire on their own.

Test: unit tests for the release rule, and two store-backed tests
(sqlite, test_mode): a rename drops the old lease after the grace
period, and a host renewing the old name after start is left alone.

Fixes #458
2026-11-18 13:43:29 -07:00