-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: Allow multiple discover operations #21164
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
base: master
Are you sure you want to change the base?
Conversation
| pub(crate) discover_handles: Vec<discover::DiscoverHandle>, | ||
| pub(crate) discover_sender: Sender<discover::DiscoverProjectMessage>, | ||
| pub(crate) discover_receiver: Receiver<discover::DiscoverProjectMessage>, | ||
| pub(crate) discover_jobs_active: AtomicU32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could actually be a plain u32. I saw the mutexes elsewhere in this struct but I'm not accessing this value from other threads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be a u32, we only write to it in &mut self paths, so there is no point in using an atomic here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
1cf1798 to
3d78edb
Compare
|
has been a while since that test flaked |
|
Huh, it's |
Previously, rust-analyzer would drop discover requests that arrived before we'd finished processing the previous request. Fix this by allowing multiple discover requests to be active. Keep track of the number of discover operations for the quiescence check, and keep the process handles until they terminate.
3d78edb to
d2505d9
Compare
|
Rebased to trigger another CI run. |
Previously, rust-analyzer would drop discover requests that arrived before we'd finished processing the previous request.
This is particularly noticeable when starting VS Code with multiple Rust files which require separate configuration discovery, as only the first file gets IDE features.
Fix this by allowing multiple discover requests to be active. Keep track of the number of discover operations for the quiescence check, and keep the process handles until they terminate.