robinedwards commented on issue #18487:
URL: https://github.com/apache/airflow/issues/18487#issuecomment-948509505


   So i have been also been working on a fix for this and the MR #18897 does 
not fix the issue.
   
   It's very simple to recreate with a test dag:
   
   ```python
   import logging
   import time
   from datetime import datetime
   
   from airflow import DAG
   from airflow.operators.python import PythonOperator
   
   
   def some_task():
       time.sleep(5)
       logging.info("Slept for 5")
   
   
   dag = DAG(
       dag_id="aa_catchup_1",
       schedule_interval='@daily',
       catchup=True,
       start_date=datetime(2021, 9, 9),
       max_active_runs=1,
       max_active_tasks=1,
   )
   
   
   with dag:
       PythonOperator(
           task_id="some_task",
           python_callable=some_task
       )
   ```
   
   1. Launch this dag
   2. let it schedule a couple of dag runs (to simulate it being behind 
schedule)
   3. Pause it.
   4. Edit the dag file to `catchup=False`
   5. Restart the scheduler
   6. Confirm in the UI that the dag details now read `catchup=False`
   ** Now we have a dag that is `catchup=False` and is behind schedule **
   7. Enable the dag
   8. The next dag run it schedules will still not be the latest it will simply 
be the next dagrun from the current state
   
   @jedcunningham or @ephraimbuddy would you kindly re-open this issue an i can 
provide a PR 
   


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