actions / actions/runner-container-hooks

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

Open
#396 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
153
Forks
112
Avg merge
6m
Merged PRs (30d)
1

Description

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 #333, so the heartbeat path ships alongside this.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/k8s/src/k8s/index.ts at execPodStep and trace the result through RunScriptStep and its entrypoint, comparing the behavior with RunContainerStep. Reproduce a Success WebSocket close without an exit code, then verify that the step fails instead of reporting exit 0 and consider the requested release including #333.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, typescript
Domain
ci-cd, devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.