Files
woodpecker/pipeline
Sam Richard b1cbd961b2 Fix/docker kill container on cancel (#6018)
## Fix: kill docker container on pipeline cancellation

### What was happening
When a pipeline step was canceled (e.g. manual cancel or agent shutdown), the Docker backend would stop waiting for the container but **would not actively terminate it**.  
This caused containers running long-lived commands (like `sleep`, `tail -f`, servers, etc.) to continue running in the background.

## Related Issue
Closes #6016 

### What this PR changes
This PR ensures that **when the step context is canceled**, the running Docker container is **immediately killed**.

- Listens to `ctx.Done()` in `WaitStep`
- Sends a `ContainerKill` using a non-cancelable context
- Preserves existing behavior for normal container exit
- Prevents orphaned containers after pipeline cancellation

### Why this approach
Docker containers do not automatically stop when the caller context is canceled.  
Explicitly killing the container on `ctx.Done()` guarantees correct cleanup and matches expected CI behavior.
2026-01-27 00:19:44 +01:00
..
2024-05-24 22:35:04 +02:00
2024-12-22 10:44:34 +01:00
2024-12-22 10:44:34 +01:00
2024-07-14 01:06:20 +02:00