Repository navigation
fix(cache): add an idle deadline for body streams - #222
perfloop[bot] wants to merge 5 commits into
Conversation
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4d72a57. Configure here.
4d72a57 to
0a871fe
Compare
|
Addressed in The cache-read watchdog now covers the complete body and range paths, rejects late chunks after cancellation, and keeps committed failures terminal. Added boundary tests cover these response and cancellation cases. |
|
Superseded by #270: a size-scaled context.WithTimeout per cache read (30s floor + 1s/MiB for buffered reads and probes, a flat 5-minute cap equal to the server WriteTimeout for client-paced streams) instead of the idle watchdog, per-write CAS and new config key. |

Cached object reads now use a configurable idle timeout for whole-object, range, and block-range streams. Each read derives a child context from the request, resets the timeout after each non-empty cache chunk, and pauses the timeout while the destination write is in progress. The default is 60 seconds and is documented in the YAML and environment configuration.
The cache-hit path keeps response headers uncommitted until the first body chunk so an idle read can fall back upstream without sending cache bytes. Once headers are committed, idle failures remain partial cache responses and never start an upstream remainder request. A late cache chunk cannot commit a response after the watchdog has canceled the read. Healthy streams use an idle-gap policy rather than a total transfer deadline.
Tests cover context propagation, first and inter-chunk stalls, empty chunks, healthy gaps, slow destination writes, whole-object ranges, block ranges, pre-header fallback, and post-commit behavior. Validation runs
make lint-ci,make build,make test,make test-integration,make test-race,make test-coverage, andmake vet.Workload:
stalled concurrent cache-hit admissionns/oprequest_p95_nscapacity_recovery_ns/opGenerated by Perfloop. Measurements and checks.