Fix prefix health checks after config reloads#128
Merged
encodeous merged 2 commits intoJul 2, 2026
Conversation
Keep existing running prefix health checks when a config reload contains an equivalent prefix configuration. If the same prefix changes health config, stop the old checker and start the new one before wiring the advertisement. This prevents config reloads from advertising a newly unmarshaled but unstarted health checker with its default metric.
There was a problem hiding this comment.
Pull request overview
This PR fixes prefix health-check behavior across central config reloads by distinguishing “same prefix, same health config” from “same prefix, changed health config,” ensuring health check goroutines are started/stopped correctly and advertisements point at running checkers.
Changes:
- Reworks
reconcileAdvertisedPrefixesto reuse existing running prefix health checkers when the effective health-check configuration is unchanged, and to stop/start checkers when it changes. - Adds
samePrefixHealthConfig(plus helpers) to compare health-check configs while accounting for tunable defaults. - Adds regression tests covering changed health-check configs starting correctly and unchanged configs reusing the running checker.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/nylon_apply.go | Updates advertised-prefix reconciliation to preserve or restart prefix health checkers based on health config equivalence, and adds config-comparison helpers. |
| core/nylon_apply_test.go | Adds tests validating correct start/reuse behavior of prefix health checkers during config reload reconciliation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
Thanks for this PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should fix prefix health-check handling during central config reloads.
Previously, Nylon reconciled advertised prefixes by prefix address only. If a config reload kept the same prefix but changed its health-check configuration, the prefix was treated as already active. Nylon then rewired the advertisement to the newly unmarshaled health-check object without starting it. For HTTP/ping health checks, that could leave the advertised metric at the object’s zero/default value instead of reflecting probe health.
Now, equivalent prefix health configs keep the existing running checker. Changed prefix health configs stop the old checker, start the new checker, and wire the advertisement to the running checker.
This matters for health-gated anycast prefixes distributed through central config updates. Without this fix, a provider can continue advertising a prefix as healthy after a reload even though the new health checker was never started.
Tests
go test ./corego test ./...