Skip to main content

spawn_exec_task

Function spawn_exec_task 

Source
fn spawn_exec_task(
    task_id: String,
    req: ExecRequest,
    stream_tx: Option<Sender<OutputChunk>>,
)
Expand description

后台执行容器任务的核心:信号量限并发 → clamp_limits → 调用 runner → 写 EXEC_TASKS。

start_exec(轮询路径)与 start_exec_stream(SSE 路径)共用本函数, 唯一的行为分叉是 stream_tx

其余(并发槽获取、资源钳制、状态映射、超时/失败脱敏、日志前缀)两条路径完全一致。 两个 runner 返回元组仅末尾多一个 _timed_out,此处统一裁成 4 元组后续处理。