Repository navigation
fix: memory leak in extension host hierarchy - #336023
Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit intoSep 18, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The cancellation guards directly prevent orphaned cache entries and are covered for both hierarchy implementations.
Pull request overview
Prevents canceled hierarchy requests from leaking provider-returned items in extension-host caches.
Changes:
- Skip call/type hierarchy session creation after cancellation.
- Add regression tests for canceled and active session lifecycles.
File summaries
| File | Description |
|---|---|
src/vs/workbench/api/common/extHostLanguageFeatures.ts |
Guards session caching after provider completion. |
src/vs/workbench/api/test/browser/extHostHierarchy.test.ts |
Tests cancellation cleanup and explicit release behavior. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 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:25
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Nick Trogh (ntrogh)
approved these changes
Sep 18, 2026
Henning Dieterichs (hediet)
approved these changes
Sep 18, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-extHostHierarchy-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
(cherry picked from commit 1ead63e)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Closing Call Hierarchy or Type Hierarchy before a provider responds can leave its returned items in the extension host's session cache. The canceled request never delivers the session ID needed to release those items.
Change
Check cancellation after the provider responds, before creating a hierarchy session.
Before
Opening and canceling both hierarchies 37 times leaves 37 extra call hierarchy items and 37 extra type hierarchy items:
After
No more growth is detected in the same 37-cycle measurement.
Test Video
video.webm