Repository navigation
fix: memory leak in workspace symbols - #336029
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits intoSep 18, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Prevents workspace-symbol requests that get canceled from caching and later resolving “late” results, which previously caused cache growth/leaks.
Changes:
- Add a new browser test suite validating cancellation doesn’t populate/resolve cached workspace symbols.
- Add a cancellation check after provider completion to avoid caching/conversion for canceled requests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/api/test/browser/extHostWorkspaceSymbols.test.ts | Adds regression tests covering symbol caching behavior under cancellation and after cache release. |
| src/vs/workbench/api/common/extHostLanguageFeatures.ts | Prevents caching/returning workspace symbols when the request token is canceled after provider returns. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 18, 2026
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
September 18, 2026 10:33
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Nick Trogh (ntrogh)
approved these changes
Sep 18, 2026
Benjamin Christopher Simmonds (benibenj)
approved these changes
Sep 18, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-extHostWorkspaceSymbols-cancellation
branch
September 20, 2026 07:39
Abdon Morales (abdonmorales)
pushed a commit
to abdonmorales/vscode-utcs
that referenced
this pull request
Sep 23, 2026
* Fix workspace symbol cache leak after cancellation * docs: explain workspace symbol cancellation cleanup (cherry picked from commit ece3c56)
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.
Details
When a workspace-symbol request is canceled before an extension finishes, the adapter still saves the late symbols in its result cache. The canceled request cannot release that cache entry.
Change
Check the cancellation token after the provider finishes, before caching or converting its symbols.
Before
When requesting and canceling workspace symbols 37 times, 37 old symbols and their locations remain in the cache:
After
No more workspace-symbol cache growth is detected in the same 37-cycle test.
Test Video
symbols-desktop-video.webm