henry3260 opened a new pull request, #70572:
URL: https://github.com/apache/airflow/pull/70572
## Why
Two comments in `task-sdk/src/airflow/sdk/execution_time/supervisor.py`
describe
behaviour the code does not have. A reader who trusts them draws the wrong
conclusion about how a task subprocess is terminated, and about which task
states reach the `finish()` endpoint.
`WatchedSubprocess.kill()` — the docstring presents the SIGINT -> SIGTERM ->
SIGKILL escalation as what always happens, so it reads as a guarantee that a
stuck process is eventually SIGKILLed. Escalation is gated on `force`, which
defaults to `False`. The default call sends a single signal, waits
`escalation_delay`, and gives up.
`ActivitySubprocess.update_task_state_if_needed()` — the comment offers
`UP_FOR_RETRY without RetryTask` as an example of a state handled by
`finish()`.
`UP_FOR_RETRY` is a member of `STATES_SENT_DIRECTLY`, so the
`not in STATES_SENT_DIRECTLY` guard is never true for it and that branch is
unreachable. `FAILED` and `SKIPPED` are the only states that get there.
## What
Comment and docstring wording only — no behaviour change, so no tests and no
newsfragment.
- `kill()`: say that only `signal_to_send` is sent unless `force=True`, and
correct the `escalation_delay` and `force` parameter descriptions.
- `update_task_state_if_needed()`: replace the unreachable `UP_FOR_RETRY`
example with `FAILED` / `SKIPPED`.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 5)
--
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]