Skip to content

Degrade quietly when the cache server is unreachable - #2

Merged
firecow merged 1 commit into
mainfrom
graceful-offline-cache
Jun 29, 2026
Merged

Degrade quietly when the cache server is unreachable#2
firecow merged 1 commit into
mainfrom
graceful-offline-cache

Conversation

@firecow

@firecow firecow commented Jun 29, 2026

Copy link
Copy Markdown
Member

Local builds with the cego/golang image flood the log with thousands of dial tcp 192.168.128.1:5930: no route to host lines, 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:

  • probes the cache server at startup — now also for an explicit --cache-server, not just gateway mode — and uses local disk only if it is unreachable;
  • adds a circuit breaker to the HTTP client: the first transport error is logged once, then operations serve from local disk without contacting the server.

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

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.
@firecow
firecow merged commit f0635fd into main Jun 29, 2026
1 check passed
@firecow
firecow deleted the graceful-offline-cache branch June 29, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant