actions / actions/runner-container-hooks
k8s mode: step reported success/exit 0 when exec stream closes mid-run without an exit code
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) resolvesresp.code || 0on a Success close with no exit code, so it does not throw.RunScriptStepthen discards that code, and the entrypoint does a hardcodedprocess.exit(0), unlikeRunContainerStepwhich 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
- Propagate the real exit code out of
execPodStep/RunScriptStep(matchRunContainerStepbehavior). - Treat a Success close with no exit code as a failure rather than exit 0.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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