Skip to content

atenet: add router health check hysteresis - #700

Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:health-hysteresis
Open

atenet: add router health check hysteresis#700
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:health-hysteresis

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown

Fixes #616

Summary

updateComponentHealth set Healthy directly from each probe result, so a single 500ms blip to Envoy's admin port or the Kubernetes API flipped /statusz unhealthy for one polling interval and paged any monitoring built on it. A component now flips unhealthy only after 3 consecutive probe failures; a single success restores it and resets the streak. A component that has never succeeded stays unhealthy (zero value), and message/last_failure/failure_count still update on every probe, so individual flaps remain observable — only the healthy boolean gains hysteresis. The health check is observability-only, so no traffic behavior changes.

Test plan

  • Unit: threshold enforcement, streak reset on recovery, never-healthy zero-value boundary; plus an integration-style test driving rh.check() with a flapping Envoy probe and asserting /statusz holds healthy through 2 transient failures, flips on the 3rd, and recovers on success. Package tests pass with -race.

  • kind cluster: deployed the router with this change and ran the e2e suites — demo, example, identity, networking, networkpolicy, and parking pass. The metrics suite fails identically on a clean-main deployment (pre-existing router-metrics-export issue), confirmed by control experiment.

  • Tests pass

  • Appropriate changes to documentation are included in the PR (none needed)

A single transient probe blip flipped /statusz unhealthy for one poll
interval, paging monitoring built on it. A component now reports
unhealthy only after 3 consecutive probe failures; one success
restores it and resets the streak. Message and failure counters still
update every probe, so flaps stay visible. Fixes agent-substrate#616.
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.

[P3] Health checker has no hysteresis — single transient probe failure flips status

1 participant