fix(registry): a heartbeat without a lease passes until LEASE_REQUIRED, live control always needs one #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/registry-lease-optional-until-required"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes a regression from #1 (registry-v1.4.0): register hands every server a lease, and heartbeat then refused a call without one whatever
LEASE_REQUIREDsaid. No shipped build sendsX-Server-Lease, so since the roll every new listing was reaped every 90 s and came back under a new join code (seen on an Edgegap rc10 server: 7YCE3X -> NJCTPK -> TE2Q4Z).LEASE_REQUIRED(off: token alone, on: 403). A wrong lease is still 403 either way.admin/next,admin/replies, from #4) always demands the lease. Without the newalwaysflag this change would have opened it to any token holder;TestLiveRefusesWhoShouldNotnow checks a lease-less poll.Tests (golang:1.22-alpine, cgo):
go vetclean,go test ./...ok. Negative controls: the oldservers.gofailsTestLeaseGuardsHeartbeatAndDeregisterandTestLegacyRowsWithoutALease, andlive.gowithalways=falsefailsTestLiveRefusesWhoShouldNot(204 for a lease-less poll).https://claude.ai/code/session_01LBCNK5JGDhbjiup5PuTutT