dstandish opened a new pull request, #60006: URL: https://github.com/apache/airflow/pull/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. -- 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]
