Skip to content

Commit 0e98c60

Browse files
XD-DENGashb
authored andcommitted
[AIRFLOW-3183] Fix bug in DagFileProcessorManager.max_runs_reached() (apache#4031)
The condition is intended to ensure the function will return False if any file's run_count is still smaller than max_run. But the operator used here is "!=". Instead, it should be "<". This is because in DagFileProcessorManager, there is no statement helping limit the upper limit of run_count. It's possible that files' run_count will be bigger than max_run. In such case, max_runs_reached() method may fail its purpose.
1 parent d266172 commit 0e98c60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

airflow/utils/dag_processing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def max_runs_reached(self):
578578
if self._max_runs == -1: # Unlimited runs.
579579
return False
580580
for file_path in self._file_paths:
581-
if self._run_count[file_path] != self._max_runs:
581+
if self._run_count[file_path] < self._max_runs:
582582
return False
583583
if self._run_count[self._heart_beat_key] < self._max_runs:
584584
return False

0 commit comments

Comments
 (0)