fix(mount): add low-memory sync diagnostics#155
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR adds low-memory mode and runtime diagnostics to the relayfile mount. New flags ChangesLow-Memory Mount Mode and Runtime Diagnostics
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Relayfile Eval ReviewRun: Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0 Human Review CasesNo reviewable human-review cases captured Relayfile output. |
There was a problem hiding this comment.
🔴 Low-memory mode inflates pendingWriteback count for all synced files
In savePublicState, when s.lowMemory is true, currentFiles is an empty map (line 2655). The else if branch at line 2691 fires for every tracked file because currentFiles[remotePath] always returns ok=false. Any tracked file that is not denied, not write-denied, has a non-empty hash, and has fileStatus == "ready" (i.e., a normally synced file) is incorrectly reclassified as "writeback-pending". This inflates the pendingWriteback counter, incorrectly sets HasPendingWriteback: true in the public state flags, and can cause the overall status to show "writeback-pending" instead of "ready". The test at internal/mountsync/syncer_test.go:3121-3126 only seeds a Dirty: true file, so the case tracked.Dirty branch matches before the else if and the bug is not caught.
(Refers to lines 2691-2693)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Fixed in ba9c28c. In low-memory mode, savePublicState now skips local-drift inference entirely instead of treating every unscanned tracked file as missing/pending. I also extended TestLowMemoryPublicStateOmitsPerFileDetails with a clean tracked file so only the dirty tracked file contributes to pendingWriteback. Verified with go test ./... .
Summary
Notes
--low-memory/RELAYFILE_MOUNT_LOW_MEMORY=trueomits detailed per-file public state and reduces bulk write batch size.--pprof-addr/RELAYFILE_MOUNT_PPROF_ADDRand--memlog-interval/RELAYFILE_MOUNT_MEMLOG_INTERVAL.Tests
go test ./...