fix: serve control status from cached snapshot to stop UI probe timeouts#2
Merged
Conversation
Root cause: ControlService.status() took the policy RLock and performed live BMC/TrueNAS reads on every UI probe; when a policy tick held the lock, the core UI's 2s control-agent request timed out and rendered intermittent agent_available=false / connection_failed despite healthy containers (baseline: 12/20 live probes failed at 2s). - status() now returns a deep-copied last-known snapshot published by each policy tick and each successful control mutation - fail-closed startup preserved: before any snapshot exists, status() performs one real tick - stale-green latch: a failed tick sets status_refresh_failed; cached status raises (HTTP 500) instead of serving prior green until the next successful tick clears it - tests: concurrency regression (25x repeat), mutation-cache publish, error-latch recovery; suite 46 passed
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.
Summary
Root cause
ControlService.status()took the sameRLockas the policy loop and then performed live BMC/TrueNAS reads. When a policy tick held the lock, the core UI's 2-second control-agent request timed out and rendered intermittentagent_available=false / connection_failed, despite both containers being healthy.Verification
44 passedruff check .: passgit diff --check: passLive acceptance plan
After merge/image publication:
/statusacross policy ticks and prove zeroconnection_failed