This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-11-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-11-test by this push:
     new a6add6b5df1 Prevent scheduler to crash due to RecursionError when 
making a SQL query (#55778)
a6add6b5df1 is described below

commit a6add6b5df1f55ecbb29b9a3fb4971a9c3059673
Author: Maksim <[email protected]>
AuthorDate: Wed Feb 11 11:35:29 2026 +0100

    Prevent scheduler to crash due to RecursionError when making a SQL query 
(#55778)
---
 airflow/jobs/scheduler_job_runner.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/airflow/jobs/scheduler_job_runner.py 
b/airflow/jobs/scheduler_job_runner.py
index 6e6a54a1758..26bd77e1023 100644
--- a/airflow/jobs/scheduler_job_runner.py
+++ b/airflow/jobs/scheduler_job_runner.py
@@ -940,7 +940,16 @@ class SchedulerJobRunner(BaseJobRunner, LoggingMixin):
                     )
                     executor.send_callback(request)
                 else:
-                    ti.handle_failure(error=msg, session=session)
+                    try:
+                        ti.handle_failure(error=msg, session=session)
+                    except RecursionError as error:
+                        self.log.error(
+                            "Impossible to handle failure for a task instance 
%s due to %s.",
+                            ti,
+                            error,
+                        )
+                        session.rollback()
+                        continue
 
         return len(event_buffer)
 

Reply via email to