Repository navigation
debug: dispose inline adapter message subscriptions - #338371
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits intoSep 28, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Conversation
Refs #293200 (ext-host-debug-1257 only). Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The lifecycle fix is narrowly scoped, preserves teardown behavior, and has comprehensive regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes an extension-host leak by releasing inline debug adapter message subscriptions when adapters stop or are disposed.
Changes:
- Tracks and disposes
onDidSendMessagesubscriptions before implementation teardown. - Adds regression coverage for disposal, shared publishers, surviving adapters, and teardown errors.
| File | Description |
|---|---|
src/vs/workbench/api/common/extHostDebugService.ts |
Disposes the inline adapter subscription during teardown. |
src/vs/workbench/api/test/browser/extHostDebugAdapters.test.ts |
Adds focused lifecycle and leak regression tests. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Refs #293200 (ext-host-debug-1257 only). Co-authored-by: Copilot <[email protected]>
Contributor
Dmitriy Vasyura (dmitrivMS)
marked this pull request as ready for review
September 28, 2026 16:45
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
September 28, 2026 16:46
Dirk Bäumer (dbaeumer)
approved these changes
Sep 28, 2026
Dmitriy Vasyura (dmitrivMS)
deleted the
agents/fix-issue-293200-ext-host-debug-1257
branch
September 28, 2026 16:53
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.
Refs #293200, only the unchecked
extHostDebugService.ts:1257direct subscription item (Matt Bierner (@mjbvz); task keyext-host-debug-1257).Problem
The original subscription is
DirectDebugAdapter's listener onimplementation.onDidSendMessage(line 1257 at issue-date revision3ef1567cc09dff5500ff510a85182a1b65da53a6, line 1273 on the baseline).Stopping a session disposes the implementation, but that does not unsubscribe the wrapper when the event publisher belongs to a longer-lived extension service. The publisher can retain the wrapper and its debug-service callback after the session ends. Session-owned publishers that release their listeners do not exhibit this leak.
Change
Validation
npm run compile-client: passed, including TypeScript compilation.DirectDebugAdaptersubscription callbacks registered through the product, sampled after settling and explicit GC; no direct class instantiation was used for the product probe.gpt-6-astraandclaude-opus-5.5, each with default reasoning effort; no actionable findings.Scope and limits
Open leak PRs #334102 and #334103 address different main-thread registrations and do not fix this subscription. No umbrella checklist changes are included.
This verifies the Windows/local synthetic inline-adapter cases above, not remote/browser extension hosts, other operating systems, arbitrary third-party adapters, or general heap-size/performance claims. Historical repro mechanisms were exercised in the synthetic product harness, not the original macOS macro extension or a nested development debugger.