Skip to content

Commit bae604c

Browse files
authored
Merge pull request #1290 from microsoft/fix/ext-host-cp-teardown
fix: debugged child processes in ext host causing teardown
2 parents a6e4d57 + 803c2c1 commit bae604c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This changelog records changes to stable releases since 1.50.2. "TBA" changes here may be available in the [nightly release](https://github.com/microsoft/vscode-js-debug/#nightly-extension) before they're in stable. Note that the minor version (`v1.X.0`) corresponds to the VS Code version js-debug is shipped in, but the patch version (`v1.50.X`) is not meaningful.
44

5+
## Nightly (only)
6+
7+
- fix: debugged child processes in ext host causing teardown ([#1289](https://github.com/microsoft/vscode-js-debug/issues/1289))
8+
59
## v1.68 (May 2022)
610

711
### v1.68.0 - 2022-05-30

src/cdp/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default class Connection {
142142
if (this._closed) return;
143143
this._closed = true;
144144
this._transport.dispose();
145-
this.logger.info(LogTag.CdpReceive, undefined, { connectionId: this._connectionId });
145+
this.logger.info(LogTag.CdpReceive, 'Connection closed', { connectionId: this._connectionId });
146146
for (const session of this._sessions.values()) session._onClose();
147147
this._sessions.clear();
148148
this._onDisconnectedEmitter.fire();

src/targets/node/extensionHostAttacher.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class ExtensionHostAttacher extends NodeAttacherBase<IExtensionHostAttach
101101
run: IRunData<IExtensionHostAttachConfiguration>,
102102
target: Cdp.Target.TargetInfo,
103103
) {
104-
return target.openerId ? {} : { initialized: () => this.onFirstInitialize(cdp, run) };
104+
return target.openerId ? {} : { initialized: () => this.onFirstInitialize(cdp, run, target) };
105105
}
106106

107107
/**
@@ -111,8 +111,9 @@ export class ExtensionHostAttacher extends NodeAttacherBase<IExtensionHostAttach
111111
protected async onFirstInitialize(
112112
cdp: Cdp.Api,
113113
run: IRunData<IExtensionHostAttachConfiguration>,
114+
target: Cdp.Target.TargetInfo,
114115
) {
115-
this.setEnvironmentVariables(cdp, run);
116+
this.setEnvironmentVariables(cdp, run, target.targetId);
116117
const telemetry = await this.gatherTelemetryFromCdp(cdp, run);
117118

118119
// Monitor the process ID we read from the telemetry. Once the VS Code
@@ -136,6 +137,7 @@ export class ExtensionHostAttacher extends NodeAttacherBase<IExtensionHostAttach
136137
private async setEnvironmentVariables(
137138
cdp: Cdp.Api,
138139
run: IRunData<IExtensionHostAttachConfiguration>,
140+
targetId: string,
139141
) {
140142
if (!run.params.autoAttachChildProcesses) {
141143
return;
@@ -144,6 +146,7 @@ export class ExtensionHostAttacher extends NodeAttacherBase<IExtensionHostAttach
144146
const vars = await this.resolveEnvironment(
145147
run,
146148
new NodeBinary('node', Semver.parse(process.versions.node)),
149+
{ openerId: targetId },
147150
);
148151

149152
for (let retries = 0; retries < 5; retries++) {

0 commit comments

Comments
 (0)