Repository navigation
Reject pending async API requests when the connection closes - #65088
Open
ShiJie Wu (wsjwu58-cmd) wants to merge 1 commit into
Open
ShiJie Wu (wsjwu58-cmd) wants to merge 1 commit into
ShiJie Wu (wsjwu58-cmd) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
ShiJie Wu (wsjwu58-cmd)
marked this pull request as ready for review
November 1, 2026 11:14
This branch has not been deployed
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.
Fixes #65089
Analysis
When the async API server disconnects during a request, vscode-jsonrpc closes the connection without rejecting pending responses. Callers can remain blocked until they explicitly close the API. Disposing immediately also risks dropping complete responses still waiting for decoding or dispatch.
Fix
Handle disconnects for socket and spawned-process clients, reject queued work, drain complete responses received before the first close event, then reject unanswered requests. Keep stale connection closures from affecting retries and wait for drained response timings before writing a timing dump.
After a writer-only close, bytes not yet delivered to the reader are discarded so an independently open reader cannot keep requests pending indefinitely. No dependencies or vendored files change.
Validation
Copilot Checklist
npx hereby validate --apicompleted without error. The command exited 1 because Go tests hit Windows paging-file/memory limits, missing symlink privileges, and an fswatch event mismatch. The three memory-related failed packages passed when rerun separately; all API suites passed.Related: #64846 handles the same underlying mechanism only during timing collection on explicit close.
AI assistance
The implementation and tests were authored with Codex using Terra max sub-agents and reviewed with AI assistance. The human operator selected this specific fix. Human code review remains pending.