Degrade quietly when the cache server is unreachable - #2
Merged
Conversation
Probe the cache server at startup (also for an explicit --cache-server, not just gateway mode) and fall back to local disk if it cannot be reached. Add a circuit breaker to the HTTP client so the first transport error is logged once and subsequent operations serve from local disk without contacting the server. Fixes local builds with the cego/golang image flooding the log with thousands of 'no route to host' lines when 192.168.128.1:5930 is not reachable.
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.
Local builds with the
cego/golangimage flood the log with thousands ofdial tcp 192.168.128.1:5930: no route to hostlines, because GOCACHEPROG is baked into the image but the cache server only exists on CI runners.The build already succeeds (HTTP failures fall back to local disk), but every cache op logs.
This:
--cache-server, not just gateway mode — and uses local disk only if it is unreachable;Verified: compiling a module with GOCACHEPROG pointed at an unreachable server went from 2234 log lines to 1, build still succeeds, and the local disk cache is populated (fast local rebuilds). New unit test covers the breaker.
🤖 Generated with Claude Code