Skip to content

Commit

Permalink
Add new type of exception to catch timeout (#42064)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladaZakharova authored Sep 6, 2024
1 parent c7882a3 commit abe5f7c
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 @@ -46,6 +46,7 @@
AirflowDagCycleException,
AirflowDagDuplicatedIdException,
AirflowException,
AirflowTaskTimeout,
)
from airflow.listeners.listener import get_listener_manager
from airflow.models.base import Base
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit abe5f7c

Please sign in to comment.