Skip to content

k8s mode: step reported success/exit 0 when exec stream closes mid-run without an exit code #396

Description

@jjoseph456

able to reproduce.

What happens

In k8s mode, when the exec WebSocket to the pod closes as "Success" with no exit code (the stream is disrupted mid-step), the step is reported as succeeded / exit 0 even though it never finished. The job goes green on a truncated step.

Where it comes from

Two spots, both present in v0.8.1 and on main:

  • execPodStep (packages/k8s/src/k8s/index.ts) resolves resp.code || 0 on a Success close with no exit code, so it does not throw.
  • RunScriptStep then discards that code, and the entrypoint does a hardcoded process.exit(0), unlike RunContainerStep which propagates the real exit code.

So a Success close that arrives with no exit code is indistinguishable from a genuine exit 0.

Why #333 does not cover it

The heartbeat PR #333 is merged but unreleased (v0.8.1 predates it), and it only handles full socket silence, not a Success close that arrives with no exit code. So it does not fix this path.

What we would like

  1. Propagate the real exit code out of execPodStep / RunScriptStep (match RunContainerStep behavior).
  2. Treat a Success close with no exit code as a failure rather than exit 0.
  3. Cut a release that includes Adding websocket heartbeat #333, so the heartbeat path ships alongside this.

Happy to test a pre-release build against a reproducing environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions