This is an automated email from the ASF dual-hosted git repository.
henry3260 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 4495ee147a2 Fail Glue job tasks promptly when a verbose job run errors
(#71570)
4495ee147a2 is described below
commit 4495ee147a242fdff07b5faf7d6e096aea1b9632
Author: rjgoyln <[email protected]>
AuthorDate: Fri Aug 14 21:06:13 2026 +0800
Fail Glue job tasks promptly when a verbose job run errors (#71570)
A run in ERROR is finished and will never reach SUCCEEDED, but the verbose
polling loop only recognised FAILED, TIMEOUT and STOPPED as failures, so it
kept polling until it ran out of attempts -- 75 minutes for GlueJobOperator
and two hours for GlueJobSensor on the default settings -- and then reported
'waiter exceeded max attempts', which reads as a timeout rather than as the
job error it is. The job_complete waiter behind the non-verbose branch has
an explicit ERROR failure acceptor.
---
providers/amazon/src/airflow/providers/amazon/aws/triggers/glue.py | 2 +-
providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/triggers/glue.py
b/providers/amazon/src/airflow/providers/amazon/aws/triggers/glue.py
index 478ce00371a..04031294660 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/triggers/glue.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/triggers/glue.py
@@ -145,7 +145,7 @@ class GlueJobCompleteTrigger(AwsBaseWaiterTrigger):
return
# STOPPED means the run was cancelled before it produced its
output, not that it succeeded.
- if job_run_state in ("FAILED", "TIMEOUT", "STOPPED"):
+ if job_run_state in ("FAILED", "TIMEOUT", "STOPPED", "ERROR"):
yield TriggerEvent(
{
"status": "error",
diff --git a/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py
b/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py
index 7281fa5ce94..e4de3b7e994 100644
--- a/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py
+++ b/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py
@@ -171,7 +171,7 @@ class TestGlueJobTrigger:
assert logs_client.get_log_events.call_count >= 2
@pytest.mark.asyncio
- @pytest.mark.parametrize("job_run_state", ["FAILED", "TIMEOUT", "STOPPED"])
+ @pytest.mark.parametrize("job_run_state", ["FAILED", "TIMEOUT", "STOPPED",
"ERROR"])
@mock.patch.object(AwsLogsHook, "get_async_conn")
@mock.patch.object(GlueJobHook, "get_async_conn")
async def test_verbose_run_failure_states(self, mock_glue_conn,
mock_logs_conn, job_run_state):