Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle timetable exception in DAG.next_dagrun_info #18729

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Oct 5, 2021

Currently, an incorrectly implemented timetable may crash the scheduler process entirely due to uncaught exceptions. This PR adds exception handlers around those calls. A failed infer_manual_data_interval() will cause the manual DAG run being skipped, and a failed next_dagrun_info() will cause the DAG run to not happen, and the DAG not being scheduled anymore (because None is set on DagModel.next_dagrun) until the DAG file is modified.

For now, the exception is simply logged. In the future we'll add a new db model similar to ImportError and hold these errors and display them on the web UI. This new model class will also be designed to incorporate ImportError eventually.

For now, the exception is simply logged and the DAG not being scheduled.
@github-actions
Copy link

github-actions bot commented Oct 5, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Oct 5, 2021
@ephraimbuddy ephraimbuddy added this to the Airflow 2.2.0 milestone Oct 5, 2021
@kaxil kaxil merged commit b0442f3 into apache:main Oct 5, 2021
@uranusjr uranusjr deleted the aip-39-catch-timetable-exceptions branch October 5, 2021 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants