Skip to content

Commit

Permalink
Add new type of exception to catch timeout (#42064) (#42078)
Browse files Browse the repository at this point in the history
(cherry picked from commit abe5f7c)

Co-authored-by: VladaZakharova <[email protected]>
  • Loading branch information
2 people authored and ephraimbuddy committed Sep 13, 2024
1 parent c7a34df commit 4b38e34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/models/dagbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
AirflowDagCycleException,
AirflowDagDuplicatedIdException,
AirflowException,
AirflowTaskTimeout,
RemovedInAirflow3Warning,
)
from airflow.listeners.listener import get_listener_manager
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4b38e34

Please sign in to comment.