Skip to content

Commit 7a37a26

Browse files
committed
detach task run process handlers
1 parent ffa2a73 commit 7a37a26

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/cli-v3/src/entryPoints/managed/execution.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,9 +950,11 @@ export class RunExecution {
950950
}
951951

952952
this.isShuttingDown = true;
953+
953954
this.snapshotPoller?.stop();
954-
this.taskRunProcess?.onTaskRunHeartbeat.detach();
955955
this.snapshotManager?.cleanup();
956+
957+
this.taskRunProcess?.unsafeDetachEvtHandlers();
956958
}
957959

958960
private async handleSuspendable(suspendableSnapshot: SnapshotState) {

packages/cli-v3/src/executions/taskRunProcess.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ export class TaskRunProcess {
9797
return this._isPreparedForNextAttempt;
9898
}
9999

100+
unsafeDetachEvtHandlers() {
101+
this.onExit.detach();
102+
this.onIsBeingKilled.detach();
103+
this.onSendDebugLog.detach();
104+
this.onSetSuspendable.detach();
105+
}
106+
100107
async cancel() {
101108
this._isPreparedForNextRun = false;
102109
this._isBeingCancelled = true;

0 commit comments

Comments
 (0)