dstandish commented on code in PR #60006:
URL: https://github.com/apache/airflow/pull/60006#discussion_r2656291641


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -2135,17 +2129,12 @@ def _schedule_dag_run(
                 session.flush()
                 self.log.info("Run %s of %s has timed-out", dag_run.run_id, 
dag_run.dag_id)
 
-                # TODO: questionable that this logic does what it is trying to 
do
-                #  I think its intent is, in part, to do this when it's the 
latest scheduled run
-                #  but it does not know that it is the latest. I think it 
could probably check that
-                #  logical date is equal to or greater than 
DagModel.next_dagrun, or something
-                if dag_run.state in State.finished_dr_states and 
dag_run.run_type == DagRunType.SCHEDULED:
-                    self._update_next_dagrun_fields(
-                        serdag=dag,
-                        dag_model=dag_model,
-                        session=session,
-                        data_interval=get_run_data_interval(dag.timetable, 
dag_run),
-                    )
+                if dag_run.state in State.finished_dr_states and 
dag_run.run_type in (
+                    DagRunType.SCHEDULED,
+                    DagRunType.MANUAL,
+                    DagRunType.ASSET_TRIGGERED,
+                ):
+                    self._check_exceeds_max_active_runs(dag_model=dag_model, 
session=session)

Review Comment:
   we should not need to call `calculate_dagrun_date_fields` here anymore, 
since it's not getting set to null to signal "exceeds max". since we're not 
adding any new runs here, we shouldn't need to change the next run.
   
   note that we can now evaluate max active runs with more dag run types, since 
we've decoupled that from the dates.



-- 
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]

Reply via email to