Skip to content

fix processKeepAlive disabled performance regression #2228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions packages/cli-v3/src/entryPoints/managed/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ export class RunExecution {
throw new Error("prepareForExecution called after process was already created");
}

// Set the task run environment so canExecute returns true
this.currentTaskRunEnv = opts.taskRunEnv;

this.taskRunProcess = await this.taskRunProcessProvider.getProcess({
taskRunEnv: opts.taskRunEnv,
isWarmStart: true,
Expand Down Expand Up @@ -584,10 +587,15 @@ export class RunExecution {

const taskRunEnv = this.currentTaskRunEnv ?? envVars;

this.taskRunProcess = await this.taskRunProcessProvider.getProcess({
taskRunEnv: { ...taskRunEnv, TRIGGER_PROJECT_REF: execution.project.ref },
isWarmStart,
});
if (!this.taskRunProcess || this.taskRunProcess.isBeingKilled) {
this.sendDebugLog("getting new task run process", { runId: execution.run.id });
this.taskRunProcess = await this.taskRunProcessProvider.getProcess({
taskRunEnv: { ...taskRunEnv, TRIGGER_PROJECT_REF: execution.project.ref },
isWarmStart,
});
} else {
this.sendDebugLog("using prepared task run process", { runId: execution.run.id });
}

this.attachTaskRunProcessHandlers(this.taskRunProcess);

Expand Down