Repository navigation
fix(daemon): leave LSP instances free after disconnect - #82
Merged
Merged
Conversation
Scient-Divergence: SA-LSP-ACQUIRE-DISCONNECT
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.
What
A client that disconnects while the daemon resolves its working directory leaves the first free language-server instance available for the next client. The daemon tracks the pending request before resolving the directory and checks the connection immediately before reserving an instance.
Why
A reservation created after disconnect cleanup could hold an otherwise free key for 30 seconds and cause the next client to start a duplicate server. The fix is also open upstream. At the next alignment, retire this contract if Oh My Pi merges it or replace it with their fix. Oh My Pi #20277
Testing
The regression test disconnects a client while its acquire is resolving the working directory. The old code resolves that acquire. The fixed code rejects it, and the next client gets instance zero.
The 15 focused daemon tests,
bun check, and the divergence check passed. The full local TypeScript run passed 238 of 247 test groups. Failures included macOS temporary-path alias mismatches and timeouts. The language-server test that timed out passed when rerun in a temporary directory without a path alias.Platforms
macOS ran the local checks above. Linux and Windows builds and isolation checks run in PR CI.
Review
Codex high reviewed
099b7cb64b40e6bb826a07451136c0b7c5b7e6c8and found no correctness blockers.bun checkpasses