Make the hard-coded 60s cache read timeout configurable
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start at src/compiler/compiler.rs around line 590, then compare the related timeout request in issue #2276 for the project's configuration approach. The change is done when the cache read timeout can be set with SCCACHE_CACHE_READ_TIMEOUT_SECS while retaining the current 60-second default.
Written by the indexing model from the issue text.
Description
Summary
The cache read timeout on the compiler path is a hard-coded 60 seconds with no way to configure it.
src/compiler/compiler.rs L590 (v0.17.0, c037e11):
// Set a maximum time limit for the cache to respond before we forge
// ahead ourselves with a compilation.
let timeout = Duration::new(60, 0);
Why it matters
When a storage backend is unhealthy or throttling rather than cleanly failing, every cacheable compilation can wait up to 60 seconds before falling back to local compilation. In a build with thousands of compiler invocations that dominates the build, and the only way to recover is to disable sccache entirely.
This is compounded by non-404 read errors being reported as misses (src/cache/cache.rs L236-L239), which makes a degraded backend hard to distinguish from a cold cache while it is happening.
For CI in particular, a much shorter timeout is usually the right trade: falling back to a local compile after a second or two is far cheaper than waiting a minute per invocation.
Proposal
Expose it as an environment variable, e.g. SCCACHE_CACHE_READ_TIMEOUT_SECS, defaulting to the current 60 so behaviour is unchanged unless set.
Similar in spirit to #2276, which asks for the same treatment of a different hard-coded timeout (REQUEST_TIMEOUT_SECS).
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 748
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/sccache
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
generate-jwt-hs256-key can produce a value that breaks generate-jwt-hs256-server-token CLI parsing Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100