vjymisal0 opened a new pull request, #71496:
URL: https://github.com/apache/airflow/pull/71496

   GlueJobCompleteTrigger's verbose polling loop and GlueJobHook's sync 
`job_completion` path both treated a Glue job run ending in `STOPPED` (e.g. 
cancelled via `on_kill` or manually from the AWS console) as a successful 
completion. Meanwhile, the deferrable non-verbose path's `job_complete` waiter 
(`providers/amazon/src/airflow/providers/amazon/aws/waiters/glue.json`) and the 
`GlueJobSensor` family (`sensors/glue.py`, `FAILURE_STATES`) already classify 
`STOPPED` as a failure.
   
   That meant the same terminal state produced a passing task in some execution 
modes (sync, or deferred+verbose) and a failing one in others (deferred, 
non-verbose), depending only on the `verbose` flag or whether the operator was 
deferred.
   
   This PR aligns all three paths on treating `STOPPED` as a failure, matching 
the existing waiter acceptors and sensor `FAILURE_STATES` convention:
   
   - `GlueJobHook._handle_state`: moved `STOPPED` from `finished_states` to 
`failed_states`.
   - `GlueJobCompleteTrigger.run()` (verbose branch): `STOPPED` now falls into 
the same branch as `FAILED`/`TIMEOUT` instead of being treated as `SUCCEEDED`.
   
   Added/extended parametrized tests in both the hook and trigger test suites 
covering `STOPPED` alongside the existing `FAILED`/`TIMEOUT` cases.
   
   closes: #71490
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Sonnet 5)
   
   Generated-by: Claude Code (Sonnet 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]

Reply via email to