jangByeongHui commented on PR #67225:
URL: https://github.com/apache/airflow/pull/67225#issuecomment-4569875461
@potiuk @eladkal @jscheffl — kindly pinging for a review on this one.
This PR fixes a real-world bug where `DockerOperator.on_kill()` stops a
container but **never** removes it when `auto_remove='force'` is set. The
orphaned container then blocks the next Dag run with a `409 Conflict` error
(tracked in #56149).
**Change summary (2 files, +55 lines):**
- `on_kill()` now calls `remove_container(force=True)` after `stop()` when
`auto_remove == "force"`, mirroring the existing behaviour in the normal
execution path.
- `APIError` is caught and logged — not re-raised — since `on_kill` is
best-effort.
- Three new unit tests cover: the happy path, non-`'force'` variants (no
removal), and the `APIError` swallow case.
The fix is minimal and intentionally mirrors the existing `auto_remove`
handling pattern. Would appreciate a quick look when you have a moment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]