diff --git a/airflow/models/dagbag.py b/airflow/models/dagbag.py index 561564a5e9323..8b155e7b526a0 100644 --- a/airflow/models/dagbag.py +++ b/airflow/models/dagbag.py @@ -46,6 +46,7 @@ AirflowDagCycleException, AirflowDagDuplicatedIdException, AirflowException, + AirflowTaskTimeout, ) from airflow.listeners.listener import get_listener_manager from airflow.models.base import Base @@ -350,7 +351,7 @@ def parse(mod_name, filepath): 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: