Skip to content

fix: keep the health deadline armed when the configured cadence is absurd - #342

Merged
cplieger merged 2 commits into
mainfrom
fix/health-lease-adoption
Sep 13, 2026
Merged

fix: keep the health deadline armed when the configured cadence is absurd#342
cplieger merged 2 commits into
mainfrom
fix/health-lease-adoption

Conversation

@cplieger

Copy link
Copy Markdown
Owner

What

Bumps github.com/cplieger/health to v1.8.0 and derives this app's probe freshness deadline from the new health.Lease instead of multiplying its interval inline.

Why

WithMaxAge takes a bare duration, so each app computed one by hand. Across the eight apps that arm a deadline, one rule was spelled six different ways, and what each multiplier meant lived only in a comment beside it.

The correctness half is overflow. A deadline derived from an operator-supplied cadence can overflow int64 nanoseconds, and WithMaxAge cannot tell a wrapped negative duration from the non-positive value that deliberately disables the deadline — so a large enough configured interval silently disarmed the wedge check the deadline exists to arm, instead of widening it. Lease.Duration() saturates at the largest representable duration instead.

The smallest disarming input is around 97 years, so this is a class fix rather than a live defect. It is worth making anyway because the failure is silent and inverted: the guard reports healthy forever rather than failing loudly.

Shape

Two commits: the dependency bump, then the adoption. The bump alone compiles and passes — Lease is purely additive to the library — so neither commit breaks a bisect.

The per-app specifics (which config value feeds the interval, what the multipliers were, and any app policy deliberately left outside the library) are in the adoption commit's own message.

Verification

gofmt, go build, go vet and the full test suite, all run with GOWORK=off so the app resolves the published health v1.8.0 rather than a local checkout.

Brings health.Lease, which the next commit adopts.
…surd

The freshness deadline was three scan intervals, multiplied inline. That product
can overflow int64 nanoseconds, and WithMaxAge cannot tell a wrapped negative
duration from the non-positive value that deliberately disables the deadline --
so a large enough SCAN_INTERVAL silently disarmed the wedge check instead of
widening it.

health.Lease does the same arithmetic with saturation, so an absurd cadence now
yields the largest representable deadline rather than none, and the field names
carry what the multiplier meant.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​cplieger/​health@​v1.7.1 ⏵ v1.8.098 +1100100100100

View full report

@cplieger
cplieger merged commit 79e5f09 into main Sep 13, 2026
23 checks passed
@cplieger
cplieger deleted the fix/health-lease-adoption branch September 13, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant