Repository navigation
Fix: bound the batched polls separately and show a failed badge as stale - #48
Merged
Merged
Conversation
/api/badges and /api/health answer only once every item has settled, so one dead service added its full 6s timeout to every tile's refresh. Give the batched fan-outs their own 2.5s deadline and keep PING_MS for a single connection test a user waits on. The badges route already reports a per-item error, which the dashboard discarded, painting a service that never answered as no badge at all. Keep the last known value and mark it out of date instead.
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
BATCH_MS(2500ms) and use it for the per-item requests in the/api/badgesand/api/healthfan-outs, so one hung service no longer holds the whole batch forPING_MS.PING_MSfor/api/badge-testand the version check, which a user runs by hand and waits on.readBadgeUpdatetobadge-logic.js, which reads one item's entry as a value or a failure rather than trustingvaluealone.activityStaleinput tocomputeBadgeVisual, reusing the existingstatus.stalestring.docs/frontend.md.Note on the shape of this fix. The tradeoff was between tightening what exists and building a real per-item state machine with server-side result caching. I took the smaller one: the cost of a dead service is a timeout that was simply too long for a background poll, and the misleading zero was information the server already sent and the frontend threw away. Caching results server-side would mean long-lived state in a project that deliberately has none, for a problem that turned out to be two small ones.
Testing
All green, apart from the Docker build smoke test, which needs a local Docker daemon. Added 2 route tests, including one proving a hung service no longer costs the batch its old deadline, and 5 frontend tests for reading a failed item and marking it stale.
Checklist