You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "rjgoyln (via GitHub)" <gi...@apache.org> on 2026/08/12 12:13:58 UTC

[PR] Fail Glue job tasks stopped mid-run in deferrable verbose mode [airflow]

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

   ## Summary
   
   A Glue job run ending in `STOPPED` — cancelled from the AWS console, or by the operator's own `on_kill` — fails the task on the non-verbose deferrable path, where the `job_complete` waiter classifies it as a failure, but succeeded on the verbose path, whose hand-rolled polling loop bucketed `STOPPED` with `SUCCEEDED`. Downstream tasks then ran on output the run never produced. The verbose branch now treats it as a failure.
   
   ## Scope
   
   The synchronous path still succeeds on `STOPPED` via `GlueJobHook._handle_state`; #71211 is reworking that path and is left to it. `GlueJobSensor` defers to the same trigger, so its deferrable verbose mode changes too, toward its own `FAILURE_STATES`, which already lists `STOPPED`.
   
   closes: #71490
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fail Glue job tasks stopped mid-run in deferrable verbose mode [airflow]

Posted by "henry3260 (via GitHub)" <gi...@apache.org>.
henry3260 commented on code in PR #71495:
URL: https://github.com/apache/airflow/pull/71495#discussion_r3777814050


##########
providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py:
##########
@@ -171,13 +171,14 @@ async def test_verbose_run_success(self, mock_glue_conn, mock_logs_conn):
         assert logs_client.get_log_events.call_count >= 2
 
     @pytest.mark.asyncio
+    @pytest.mark.parametrize("job_run_state", ["FAILED", "TIMEOUT", "STOPPED"])
     @mock.patch.object(AwsLogsHook, "get_async_conn")
     @mock.patch.object(GlueJobHook, "get_async_conn")
-    async def test_verbose_run_job_failed(self, mock_glue_conn, mock_logs_conn):
-        """When verbose=True and the job fails, the trigger yields an error event."""
+    async def test_verbose_run_job_failed(self, mock_glue_conn, mock_logs_conn, job_run_state):

Review Comment:
   ```suggestion
       async def test_verbose_run_failure_states(self, mock_glue_conn, mock_logs_conn, job_run_state):
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fail Glue job tasks stopped mid-run in deferrable verbose mode [airflow]

Posted by "rjgoyln (via GitHub)" <gi...@apache.org>.
rjgoyln commented on PR #71495:
URL: https://github.com/apache/airflow/pull/71495#issuecomment-5284768167

   > `ERROR` is the one state where the verbose branch still disagrees with the `job_complete` waiter that the non-verbose branch uses. The waiter has an explicit `{"expected": "ERROR", "state": "failure"}` acceptor and the operator's `JOB_RUN_TERMINAL_STATES` lists it, but this loop classifies only `FAILED`/`TIMEOUT`/`STOPPED` as failure and `SUCCEEDED` as success, so an `ERROR` run falls through to "keep polling" and only surfaces after `waiter_max_attempts` (75 × 60s by default for `GlueJobOperator`, 60 × 120s for `GlueJobSensor`) as `waiter exceeded max attempts` which reads as a timeout rather than as a job error.
   > 
   > It is worth to open a pr to a follow-up. Do you want to take it?
   
   Great catch! I'd be happy to take care of it. I will open a follow-up PR to handle the ERROR state shortly.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fail Glue job tasks stopped mid-run in deferrable verbose mode [airflow]

Posted by "henry3260 (via GitHub)" <gi...@apache.org>.
henry3260 merged PR #71495:
URL: https://github.com/apache/airflow/pull/71495


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org