This is an automated email from the ASF dual-hosted git repository. ephraimanierobi pushed a commit to branch sync_v2_10_test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 4b38e3429e122891d482a7981ca928995be6e75f Author: Jarek Potiuk <[email protected]> AuthorDate: Fri Sep 6 21:53:34 2024 +0200 Add new type of exception to catch timeout (#42064) (#42078) (cherry picked from commit abe5f7c68bda057396744cb70c43e9cb83c02aac) Co-authored-by: VladaZakharova <[email protected]> --- 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 f384bfcd84..761a88c0ea 100644 --- a/airflow/models/dagbag.py +++ b/airflow/models/dagbag.py @@ -47,6 +47,7 @@ from airflow.exceptions import ( AirflowDagCycleException, AirflowDagDuplicatedIdException, AirflowException, + AirflowTaskTimeout, RemovedInAirflow3Warning, ) from airflow.listeners.listener import get_listener_manager @@ -381,7 +382,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:
