ephraimbuddy commented on a change in pull request #18897:
URL: https://github.com/apache/airflow/pull/18897#discussion_r731800154
##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -885,12 +874,28 @@ def _create_dag_runs(self, dag_models:
Collection[DagModel], session: Session) -
dag_hash=dag_hash,
creating_job_id=self.id,
)
- queued_runs_of_dags[dag_model.dag_id] += 1
- dag_model.calculate_dagrun_date_fields(dag, data_interval)
-
+ active_runs_of_dags[dag.dag_id] += 1
+ self._update_dag_next_dagruns(dag, dag_model,
active_runs_of_dags[dag.dag_id])
Review comment:
Your suggestion introduces the bug that if we have a dag with
max_active_runs=1, then only that one dag will be running. The scheduler will
no more create dagruns once that condition is reached. The `defaultdict` helps
to keep count of different dag's runs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]