forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIRFLOW-678] Prevent scheduler from double triggering TIs
At the moment there is no lock/synchronization around the loop where the scheduler puts tasks in the SCHEDULED state. This means that if somehow the task starts running or gets SCHEDULED somewhere else somehow (e.g. manually running a task via the webserver) the task can have it's state changed from RUNNING/QUEUED to SCHEDULED which can cause a single task instance to be run twice at the same time. Testing Done: - Tested this branch on the Airbnb Airflow staging cluster - Airbnb has been running very similar logic in our production for many months (not 1-1 since we are still running off of the last release branch) - In the future we ideally need an integration test to catch double triggers but this is not trivial to do properly Closes apache#1924 from aoen/ddavydov/fix_scheduler_race_condition
- Loading branch information
Showing
2 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters