dfs: improve read path downloader reuse#283
Conversation
01162f3 to
a1c3005
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves DFS VFS download behavior by adding shared adaptive chunking across contiguous downloader lifecycles, enhancing downloader reuse heuristics, and introducing a grace period before stopping downloaders when the final file handle closes.
Changes:
- Add shared “adaptive state” so sequential reads don’t re-ramp chunk sizes when a nearby downloader restarts.
- Expand downloader reuse matching and add detailed trace logging for reuse, read-ahead expansion, and upstream fetches.
- Delay stopping downloaders after last handle close via a grace period; add tests for the new behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pkg/mount/dfs/vfs/downloaders_test.go | Adds tests for adaptive state inheritance/reset decisions, downloader reuse matching, and grace-period stop/cancel behavior. |
| pkg/mount/dfs/vfs/downloaders.go | Implements shared adaptive state, extends downloader matching to include assigned range, and adds multiple trace events around downloader lifecycle/read-ahead/upstream fetch. |
| pkg/mount/dfs/vfs/cache.go | Adds delayed downloader shutdown with a grace-period timer, cancellation on reopen/close, and trace logging for cache misses. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Quick update on this PR: I rebased the branch onto the latest The main thing I checked during the conflict resolution was making sure we kept both sets of behavior:
I also added one small safety fix during the merge: priority/probe downloaders now avoid updating the shared adaptive state, so short probe reads should not accidentally reset or ramp down normal sequential playback behavior. Validation completed:
go test ./pkg/mount/dfs/vfs -count=1 -vResult: targeted DFS/VFS tests passed. Note: I’m not claiming a full |
6f30cf0 to
a08bc4e
Compare
|
Updated the PR based on the review feedback. Changes made:
Validated locally:
All passed locally. |
|
Added one more lock-order fix so Validated locally with:
All passed locally. |
📌 Description
Target Branch Check (IMPORTANT)
Expected target:
Changes Made
Testing
Steps:
upstream/beta.go test ./pkg/mount/dfs/vfs -vRisks / Notes
go test ./...currently has unrelated failures onupstream/betain:internal/utilspkg/usenet/fs/readerScreenshots (if applicable)
N/A
Checklist