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

potiuk 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 abe5f7c68b Add new type of exception to catch timeout (#42064)
abe5f7c68b is described below

commit abe5f7c68bda057396744cb70c43e9cb83c02aac
Author: VladaZakharova <[email protected]>
AuthorDate: Fri Sep 6 21:04:06 2024 +0200

    Add new type of exception to catch timeout (#42064)
---
 airflow/models/dagbag.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/models/dagbag.py b/airflow/models/dagbag.py
index 561564a5e9..8b155e7b52 100644
--- a/airflow/models/dagbag.py
+++ b/airflow/models/dagbag.py
@@ -46,6 +46,7 @@ from airflow.exceptions import (
     AirflowDagCycleException,
     AirflowDagDuplicatedIdException,
     AirflowException,
+    AirflowTaskTimeout,
 )
 from airflow.listeners.listener import get_listener_manager
 from airflow.models.base import Base
@@ -350,7 +351,7 @@ class DagBag(LoggingMixin):
                 sys.modules[spec.name] = new_module
                 loader.exec_module(new_module)
                 return [new_module]
-            except Exception as e:
+            except (Exception, AirflowTaskTimeout) as e:
                 DagContext.autoregistered_dags.clear()
                 self.log.exception("Failed to import: %s", filepath)
                 if self.dagbag_import_error_tracebacks:

Reply via email to