petern48 opened a new pull request, #76895: URL: https://github.com/apache/airflow/pull/76895
When a trigger of a **mapped** task is cancelled, `safe_to_cancel()` calls `get_task_state()` to decide whether the task is still deferred. The execution API (`GET /task-instances/states`) keys a mapped task instance as `<task_id>_<map_index>`, but the Google triggers indexed the response by plain `task_id`. The lookup raised, so `safe_to_cancel()` failed with `TaskInstance ... is not found` and the task failed instead of staying deferred (or having its external job cancelled when appropriate). This builds the key from `map_index` (plain `task_id` when `map_index < 0`) in `get_task_state()` of: - `DataprocSubmitTrigger` - `DataprocSubmitJobDirectTrigger` - `DataprocClusterTrigger` - `BigQueryInsertJobTrigger` On Airflow 3.3+ the Dataproc submit and BigQuery triggers don't use this code path (`AIRFLOW_V_3_3_PLUS`), so the change only affects Airflow 3.0 to 3.2. `DataprocClusterTrigger` is unconditional. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: Claude Code (Claude Sonnet 5.5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
