buildkite / buildkite/agent

Exit code 0 when terminating in the WebUI

Open
#3,052 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

The documentation states that `buildkite-agent` should exit with code 255 if "The agent was gracefully terminated". I assumed that this would be the case when clicking the "Stop Agent" button in the WebUI, however, it seems like that simply exits with code 0.

This is a problem for me, because I run `buildkite-agent` in one-shot mode, i.e., passing `--disconnect-after-job`. In that case, it's impossible to distinguish between a completed or canceled job (both exiting with code 0, as expected) and one where I requested the agent to terminate (where I expected code 255). I would like this information to do something like:

```sh
while true; do
buildkite-agent --disconnect-after-job
if [[ ret -eq 255]; then
break
fi
done
```

FYI, I'm using `--disconnect-after-job` for containerization purposes, running all of `buildkite-agent` under `sandbox-exec` or `docker`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.