Bootstrap cancel timeout can leave per-job temporary directories behind
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 378
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 74
Description
If a [per-job bootstrap process](https://github.com/buildkite/agent/blob/main/agent/job_runner.go#L425-L440) is forcibly terminated, any temporary directories it has created (such as in the [empty `BUILDKITE_REPO` case](https://github.com/buildkite/agent/issues/1485#issue-970092354)) will not be cleaned up.
This is hard to solve in the general case since the bootstrap process tree involves user supplied code, but we can at least clean up the directories our agent is responsible for having created.
Contributor guide
Research direction
Start in agent/job_runner.go around lines 425-440, then trace the cancellation path for a forcibly terminated per-job bootstrap process and the empty BUILDKITE_REPO case. Identify which temporary directories the agent itself creates and define completion as cleaning those directories up when bootstrap cancellation occurs, without assuming user-supplied process-tree code can be cleaned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100