fix(daemon): guard large root before snapshot restore#2
Merged
Conversation
The guard ran after the warm-start snapshot restore, so a daemon pointed at a home directory or drive root still loaded a previously written (and possibly multi-GB) graph.json before bailing — defeating the OOM protection. Hoist the check above the restore so an oversized root skips snapshot restore, indexing, and watching alike.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@
Problem
feat/index-root-guards(#1) added a guard that skips auto-indexing a workspace rooted at a drive root or home directory — but the check ran after the warm-start snapshot restore. A daemon pointed at such a root stillread_to_string+serde_json::from_strthe existinggraph.jsonfirst.Found live:
C:\Users\nevermore\.continuum\graph.jsonhad grown to 2.4 GB (129182 home files indexed by a pre-guard build). A 0.1.5 daemon restarted there hangs/OOMs loading that snapshot before the guard fires.Fix
Hoist
unsafe_index_rootabove the snapshot restore. An oversized root now skips snapshot restore, indexing, and watching alike; the daemon still binds and serves memory + on-demand text search.Verify
Startup is immediate (~4 ms) — the 2.4 GB graph.json is never read. Confirmed against the real home directory.
@