You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "collinmcnulty (via GitHub)" <gi...@apache.org> on 2025/03/10 13:41:25 UTC

[I] MultipleCronTimetable does not handle catchup=False correctly on unpause [airflow]

collinmcnulty opened a new issue, #47566:
URL: https://github.com/apache/airflow/issues/47566

   ### Apache Airflow version
   
   2.10.5
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   MultipleCronTimetable's catchup behavior is individualized amongst all the underlying CronTriggerTimetables but not synthesized at the overall Timetable level. This means when you unpause it, all the underlying timetables catch up.
   
   ### What you think should happen instead?
   
   Only the most recent run of the overall timetable should run if catchup=False. For example, if I have a timetable that runs on Tuesdays a 8 AM and Thursdays at 11 AM, then pause the DAG from Monday to Friday, when I unpause it on Friday, only the Thursday at 11 AM run should start. But right now, both runs would start.
   
   ### How to reproduce
   
   - Make a DAG with a MultipleCronTimetable
   - Run it for at once cycle of the underlying crons
   - Pause the DAG
   - Wait at least one full cycle of the underlying crons
   - Unpause it
   - Observe that the last run of _each_ underlying timetable runs, not just the most recent run overall.
   
   ### Operating System
   
   debian bullseye
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] MultipleCronTimetable does not handle catchup=False correctly on unpause [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on issue #47566:
URL: https://github.com/apache/airflow/issues/47566#issuecomment-2720628249

    #47716


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] MultipleCronTimetable does not handle catchup=False correctly on unpause [airflow]

Posted by "collinmcnulty (via GitHub)" <gi...@apache.org>.
collinmcnulty commented on issue #47566:
URL: https://github.com/apache/airflow/issues/47566#issuecomment-2715741509

   @uranusjr No. Although Multi-cron stores multiple cron tables internally, this isn't how users think about the schedule. If I set my DAG to run Tuesdays at 8 and Thursdays at 12, I don't think of those as independent. So after unpause I only want to run the most recent overall run, not the most recent in each of the underlying timetables.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] MultipleCronTimetable does not handle catchup=False correctly on unpause [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on issue #47566:
URL: https://github.com/apache/airflow/issues/47566#issuecomment-2720505090

   OK so the problem is not two runs are created _when_ you unpause, but a run earlier than expected is, resulting in unwanted additional runs afterwards to be created. Is this correct? Assuming so, your fix makes sense to me.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] MultipleCronTimetable does not handle catchup=False correctly on unpause [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr closed issue #47566: MultipleCronTimetable does not handle catchup=False correctly on unpause
URL: https://github.com/apache/airflow/issues/47566


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] MultipleCronTimetable does not handle catchup=False correctly on unpause [airflow]

Posted by "collinmcnulty (via GitHub)" <gi...@apache.org>.
collinmcnulty commented on issue #47566:
URL: https://github.com/apache/airflow/issues/47566#issuecomment-2710642110

   I believe the problem is [here](https://github.com/apache/airflow/pull/46451/files#diff-fd0aa1371afdbd63292ca603092779e412fac21326bd69bcb1992513b436b01fR267). Instead of a strict minimum, restriction.catchup should be checked, and if it's False, it should pick the max of runs with next_run before the current time or the minimum of runs after the current time.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] MultipleCronTimetable does not handle catchup=False correctly on unpause [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on issue #47566:
URL: https://github.com/apache/airflow/issues/47566#issuecomment-2712561216

   If catchup is false, shouldn’t all timetables inside return some time after the current time? And we should select the one closest to the current time. I’m likely not thinking this through.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org