diff --git a/airflow/models/dagbag.py b/airflow/models/dagbag.py index f384bfcd84ea..761a88c0ea9a 100644 --- a/airflow/models/dagbag.py +++ b/airflow/models/dagbag.py @@ -47,6 +47,7 @@ AirflowDagCycleException, AirflowDagDuplicatedIdException, AirflowException, + AirflowTaskTimeout, RemovedInAirflow3Warning, ) from airflow.listeners.listener import get_listener_manager @@ -381,7 +382,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: