The GitHub Actions job "Tests" on airflow.git/main has succeeded.
Run started by GitHub user potiuk (triggered by potiuk).

Head commit for run:
32bc0119b408c9a37841edd021b646324a02745e / Daniel Standish 
<[email protected]>
Separate "next dag run" from "max active runs" (#60006)

Previously we used one field to serve two purposes.

1. what's the next dag run that should be created
2. whether max active runs is exceeded (and therefore scheduler should not 
bother creating)

Previously we would set next_dagrun and next_dagrun_create_after to NULL when 
max active runs is exceeded.

This .... basically worked but it had some bad consequences.

It made the logic at call site more confuing because of all the conditionals.

And by nulling out the value, it forced us to re-set the value with possibly 
incorrect data.

For example previously if it was null we would possibly re-set it every time a 
dag run completed. And we would use the data interval of the just-completed dag 
run to set it.  But if the dag run that just completed was not the latest one, 
then we would set it to a value that is not the latest time! And we can't even 
easily *check* if we have the "latest run" because, if it is null, there's no 
value to compare with.

So, what I do here is add a boolean field to mark when the dag has exceeded max 
active runs.  And I set that separately from the next dag run info.  And I only 
set the next dag run info when we create a new dag run; if we never "unset" it, 
then we don't need to re-set it in those scenarios.

Report URL: https://github.com/apache/airflow/actions/runs/20804869195

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to