Skip to content

Conversation

@tmm1
Copy link
Contributor

@tmm1 tmm1 commented Aug 28, 2025

[LEAKED DISPOSABLE] Error: CREATED via:
at GCBasedDisposableTracker.trackDisposable src/vs/base/common/lifecycle.ts:47:23
at trackDisposable src/vs/base/common/lifecycle.ts:218:24
at toDisposable src/vs/base/common/lifecycle.ts:296:18
at BrowserWebSocket._event [as onOpen] src/vs/base/common/event.ts:879:28
at new Promise ()
at BrowserSocketFactory.connect src/vs/platform/remote/browser/browserSocketFactory.ts:194:16
at RemoteSocketFactoryService.connect src/vs/platform/remote/common/remoteSocketFactoryService.ts:31:30
at createSocket src/vs/platform/remote/common/remoteAgentConnection.ts:122:32
at connectToRemoteExtensionHostAgent src/vs/platform/remote/common/remoteAgentConnection.ts:159:24
at connectToRemoteExtensionHostAgentAndReadOneMessage src/vs/platform/remote/common/remoteAgentConnection.ts:232:46
at doConnectRemoteAgentExtensionHost src/vs/platform/remote/common/remoteAgentConnection.ts:258:46
at ExtensionHostPersistentConnection._reconnect src/vs/platform/remote/common/remoteAgentConnection.ts:622:15
at ExtensionHostPersistentConnection._runReconnectingLoop src/vs/platform/remote/common/remoteAgentConnection.ts:515:28
at async ExtensionHostPersistentConnection._beginReconnecting src/vs/platform/remote/common/remoteAgentConnection.ts:470:13

tmm1 added 2 commits August 27, 2025 19:52
[LEAKED DISPOSABLE] Error: CREATED via:
  at GCBasedDisposableTracker.trackDisposable src/vs/base/common/lifecycle.ts:47:23
  at trackDisposable src/vs/base/common/lifecycle.ts:218:24
  at toDisposable src/vs/base/common/lifecycle.ts:296:18
  at BrowserWebSocket._event [as onOpen] src/vs/base/common/event.ts:879:28
  at new Promise (<anonymous>)
  at BrowserSocketFactory.connect src/vs/platform/remote/browser/browserSocketFactory.ts:194:16
  at RemoteSocketFactoryService.connect src/vs/platform/remote/common/remoteSocketFactoryService.ts:31:30
  at createSocket src/vs/platform/remote/common/remoteAgentConnection.ts:122:32
  at connectToRemoteExtensionHostAgent src/vs/platform/remote/common/remoteAgentConnection.ts:159:24
  at connectToRemoteExtensionHostAgentAndReadOneMessage src/vs/platform/remote/common/remoteAgentConnection.ts:232:46
  at doConnectRemoteAgentExtensionHost src/vs/platform/remote/common/remoteAgentConnection.ts:258:46
  at ExtensionHostPersistentConnection._reconnect src/vs/platform/remote/common/remoteAgentConnection.ts:622:15
  at ExtensionHostPersistentConnection._runReconnectingLoop src/vs/platform/remote/common/remoteAgentConnection.ts:515:28
  at async ExtensionHostPersistentConnection._beginReconnecting src/vs/platform/remote/common/remoteAgentConnection.ts:470:13
Copilot AI review requested due to automatic review settings September 22, 2025 06:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a disposable leak in the BrowserSocketFactory where event listeners were not being properly cleaned up. The fix ensures that both the error listener and open listener are properly disposed when the socket connection is established.

  • Replaces manual disposable management with a DisposableStore to track multiple listeners
  • Ensures both onError and onOpen listeners are properly cleaned up when the connection succeeds

@bpasero bpasero removed the request for review from alexdima September 22, 2025 06:58
@bpasero bpasero added this to the September 2025 milestone Sep 22, 2025
@bpasero bpasero assigned bpasero and unassigned TylerLeonhardt Sep 22, 2025
@bpasero bpasero enabled auto-merge (squash) September 22, 2025 07:16
@bpasero bpasero merged commit 1632f31 into microsoft:main Sep 22, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants