[ 
https://issues.apache.org/jira/browse/AIRFLOW-3183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16647527#comment-16647527
 ] 

ASF GitHub Bot commented on AIRFLOW-3183:
-----------------------------------------

Fokko closed pull request #4031: [AIRFLOW-3183] Fix bug in 
DagFileProcessorManager.max_runs_reached()
URL: https://github.com/apache/incubator-airflow/pull/4031
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/utils/dag_processing.py b/airflow/utils/dag_processing.py
index 8ddddad104..8b77c796d2 100644
--- a/airflow/utils/dag_processing.py
+++ b/airflow/utils/dag_processing.py
@@ -578,7 +578,7 @@ def max_runs_reached(self):
         if self._max_runs == -1:  # Unlimited runs.
             return False
         for file_path in self._file_paths:
-            if self._run_count[file_path] != self._max_runs:
+            if self._run_count[file_path] < self._max_runs:
                 return False
         if self._run_count[self._heart_beat_key] < self._max_runs:
             return False


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Potential Bug in 
> utils/dag_processing/DagFileProcessorManager.max_runs_reached()
> --------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-3183
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3183
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: 1.10.0
>            Reporter: Xiaodong DENG
>            Assignee: Xiaodong DENG
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> In 
> [https://github.com/apache/incubator-airflow/blob/df7c16a3ce01625277dd2e5c4ce4ed096dcfbb40/airflow/utils/dag_processing.py#L581,]
>  the condition is to ensure the function will return False if any file's 
> run_count is 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.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to