Skip to content

Commit b5bea23

Browse files
authored
Fix SSE connection timeout using background context for workload startup (#1582)
Signed-off-by: lujunsan <[email protected]>
1 parent 1ad7193 commit b5bea23

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/workloads/manager.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,8 @@ func (d *defaultManager) restartRemoteWorkload(
662662
logger.Infof("Loaded configuration from state for %s", runConfig.BaseName)
663663

664664
// Start the remote workload using the loaded runner
665-
return d.startWorkload(childCtx, name, mcpRunner, foreground)
665+
// Use background context to avoid timeout cancellation - same reasoning as container workloads
666+
return d.startWorkload(context.Background(), name, mcpRunner, foreground)
666667
}
667668

668669
// restartContainerWorkload handles restarting a container-based workload
@@ -695,8 +696,10 @@ func (d *defaultManager) restartContainerWorkload(childCtx context.Context, name
695696
return err
696697
}
697698

698-
// Start the workload
699-
return d.startWorkload(childCtx, name, mcpRunner, foreground)
699+
// Start the workload with background context to avoid timeout cancellation
700+
// The childCtx with AsyncOperationTimeout is only for the restart setup operations,
701+
// but the actual workload should run indefinitely with its own lifecycle management
702+
return d.startWorkload(context.Background(), name, mcpRunner, foreground)
700703
}
701704

702705
// workloadState holds the current state of a workload for restart operations

0 commit comments

Comments
 (0)