You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ReadAheadManager.Stop has no production caller; the unmount path relies on context cancellation alone #376
ReadAheadManager.Stop (internal/fuse/optimizations.go) is exported, sync.Once-guarded, and documented "safe to call multiple times (#104)". Its only callers are in read_path_test.go and readahead_lifetime_test.go. Not MountManager.Unmount, not Adapter.Stop, not anything on the unmount path.
Before the fix in #179 that meant a real leak: five goroutines per NewFileSystem at the default ConcurrentReads: 4, measured 2 → 27 after five constructions, each holding its FileSystem — and through it the backend and cache — reachable for the life of the process.
That leak is fixed, and deliberately not by adding a Stop call. NewReadAheadManager takes the mount's context and both workers select on mount.Done(), so the cancelMount() the adapter already performs is what ends them — no new obligation for a future caller to remember, which is exactly the obligation that was already being missed.
What remains is a smaller, non-urgent inconsistency: an exported lifecycle method that production never calls. Two defensible resolutions, and this issue is to pick one rather than leave both open:
Call it on the unmount path and keep cancellation as the backstop. Belt and braces, at the cost of the same "someone must remember" property on any future mount path.
Unexport or document it as test-only. Cancellation is the production mechanism; stopCh exists so a test can stop a manager whose context it does not own.
Leaning to (2), since (1) reintroduces the coupling the fix removed — but either is fine as long as the code says which one it is. Today a reader finds an exported Stop, reasonably assumes the unmount path calls it, and is wrong.
Not a correctness bug as of #179. Filed so the dead-in-production method does not sit unexplained.
Activity
fix: read-ahead leaked five goroutines per mount
lint: range over integers, and stop linting a dependency's Go files (#…
feat(s3): a write that happens only if an assertion about the key hol…
refactor(fuse): delete ReadAheadManager.Stop and its channel (#376) (#…
refactor(cache): delete redis's pub/sub Invalidator, which deleted fr…