-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbage collection does not work with certain types stored in the Engines
#5814
Comments
Ok I have been able to reproduce this error with the new test consistently within 1-5 did_change events at this commit 348d008 I just rebased onto master and have done 8 successful local runs 1 time it produced the same crash as above, the other 7 times it now handles 600 did_change events with GC on every keystroke without a problem. Running this test in CI seems to fail everytime still.... |
Just leaving some more info. It seems that this error occurs when compilation is started and completed successfully, but the
|
Ok I think i'm narrowing in on this. Compilation is returning an old cached AST. let cache_up_to_date = entry.modified_time == modified_time || {
let src = std::fs::read_to_string(path.as_path()).unwrap();
let mut hasher = DefaultHasher::new();
src.hash(&mut hasher);
let hash = hasher.finish();
hash == entry.hash
}; In this instance, we hit the || and load the file from the path into a string and compare. Now, because we actually write into this file from the LSP, the compiler may be have been trigger by a did_change event, and during this the LSP has actually saved a newer copy at this location. This would explain why I originally found this error while rapidly triggering between enter and backspace events. |
Ok i've got a fix up now at #5813 turned out to be 3 things
|
I've just opened up a draft PR #5813 with a new test called
garbage_collection_storage
that is able to reproduce this. Running the test produces the following stack trace.The text was updated successfully, but these errors were encountered: