Skip to content

redis: add configurable IO timeouts - #2965

Merged
sylvestre merged 3 commits into
mozilla:mainfrom
aw1cks-forks:redis-io-timeout
Nov 20, 2026
Merged

sylvestre merged 3 commits into
mozilla:mainfrom
aw1cks-forks:redis-io-timeout

Conversation

@aw1cks

@aw1cks aw1cks commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

When using a disk,redis tiered cache, an unavailable Redis can delay local compilation if disk misses - this can end up waiting for OpenDAL’s 10-second pool-acquisition deadline[1].
The default overall cache-read timeout is 60 seconds, so it does not shorten this wait. In client-side mode, even shortening the overall cache-read timeout does not reliably bound command completion.

As such I propose to add an optional SCCACHE_REDIS_IO_TIMEOUT_SECS which allows setting a shorter Redis-specific IO deadline (including connection acquisition). This uses the TimeoutLayer middleware[2].

When the config is unset, previous behavior is preserved.

[1] https://docs.rs/opendal-service-redis/0.58.1/src/opendal_service_redis/core.rs.html#158-170
[2] https://docs.rs/opendal-layer-timeout/0.58.1/opendal_layer_timeout/struct.TimeoutLayer.html

@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.27%. Comparing base (ef8e7d7) to head (4b4c838).

Files with missing lines Patch % Lines
src/cache/cache.rs 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2965      +/-   ##
==========================================
+ Coverage   78.92%   79.27%   +0.34%     
==========================================
  Files          75       75              
  Lines       46005    46107     +102     
==========================================
+ Hits        36310    36550     +240     
+ Misses       9695     9557     -138     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/config.rs Resolved
Comment thread src/config.rs Resolved
Comment thread src/compiler/nvcc.rs Resolved
A stalled Redis connection can keep a disk-cache miss waiting for the
pool even though the compiler could run locally. Install an OpenDAL
TimeoutLayer for Redis reads and writes only when a positive deadline
is configured. Read it from the same source as the endpoint; unset
preserves the existing behavior.

Use a silent listener and a paused clock to distinguish the configured
IO deadline from the cluster client’s own connection timeout.
@sylvestre
sylvestre merged commit ff133d3 into mozilla:main Nov 20, 2026
51 checks passed
@sylvestre

Copy link
Copy Markdown
Collaborator

Thanks for your PR

@aw1cks
aw1cks deleted the redis-io-timeout branch November 20, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants