nsepetys opened a new issue #18398:
URL: https://github.com/apache/airflow/issues/18398


   ### Apache Airflow version
   
   2.1.4 (latest released)
   
   ### Operating System
   
   Debian GNU/Linux 10 (buster)
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==2.2.0
   apache-airflow-providers-celery==2.0.0
   apache-airflow-providers-cncf-kubernetes==2.0.2
   apache-airflow-providers-docker==2.1.1
   apache-airflow-providers-elasticsearch==2.0.3
   apache-airflow-providers-ftp==2.0.1
   apache-airflow-providers-google==5.1.0
   apache-airflow-providers-grpc==2.0.1
   apache-airflow-providers-hashicorp==2.1.0
   apache-airflow-providers-http==2.0.1
   apache-airflow-providers-imap==2.0.1
   apache-airflow-providers-microsoft-azure==3.1.1
   apache-airflow-providers-mysql==2.1.1
   apache-airflow-providers-postgres==2.2.0
   apache-airflow-providers-redis==2.0.1
   apache-airflow-providers-sendgrid==2.0.1
   apache-airflow-providers-sftp==2.1.1
   apache-airflow-providers-slack==4.0.1
   apache-airflow-providers-sqlite==2.0.1
   apache-airflow-providers-ssh==2.1.1
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   dockerfile from apache/airflow:2.1.4-python3.7
   `EXECUTOR=LocalExecutor`
   
   ### What happened
   
   After successfully running a SUBDAG, clearing it (including 
downstream+recursive) doesn't trigger the inner tasks. Instead, the subdag is 
marked successful and the inner tasks all stay cleared and are not re-ran.
   
   ### What you expected to happen
   
   Expected Clear with DownStream + Recursive to re-run all subdag tasks.
   
   ### How to reproduce
   
   1. Using a slightly modified version of 
https://airflow.apache.org/docs/apache-airflow/stable/concepts.html#subdags:
   ```python
   from airflow import DAG
   from airflow.example_dags.subdags.subdag import subdag
   from airflow.operators.dummy import DummyOperator
   from airflow.operators.subdag import SubDagOperator
   from airflow.utils.dates import days_ago
   
   def subdag(parent_dag_name, child_dag_name, args):
       dag_subdag = DAG(
           dag_id=f'{parent_dag_name}.{child_dag_name}',
           default_args=args,
           start_date=days_ago(2),
           schedule_interval=None,
       )
   
       for i in range(5):
           DummyOperator(
               task_id='{}-task-{}'.format(child_dag_name, i + 1),
               default_args=args,
               dag=dag_subdag,
           )
   
       return dag_subdag
        
   DAG_NAME = 'example_subdag_operator'
   
   args = {
       'owner': 'airflow',
   }
   
   dag = DAG(
       dag_id=DAG_NAME, default_args=args, start_date=days_ago(2), 
schedule_interval=None, tags=['example']
   )
   
   start = DummyOperator(
       task_id='start',
       dag=dag,
   )
   
   section_1 = SubDagOperator(
       task_id='section-1',
       subdag=subdag(DAG_NAME, 'section-1', args),
       dag=dag,
   )
   
   some_other_task = DummyOperator(
       task_id='some-other-task',
       dag=dag,
   )
   
   section_2 = SubDagOperator(
       task_id='section-2',
       subdag=subdag(DAG_NAME, 'section-2', args),
       dag=dag,
   )
   
   end = DummyOperator(
       task_id='end',
       dag=dag,
   )
   
   start >> section_1 >> some_other_task >> section_2 >> end
   ```
       
   
   2. Run the subdag fully.
   3.  Clear (with recursive/downstream) any of the SubDags.
   4.  The Subdag will be marked successful, but if you zoom into the subdag, 
you'll see all the child tasks were not run.
   
   
   ### Anything else
   
   This appears to be the same issues as the "resolved" bug 
https://github.com/apache/airflow/issues/13295 . Airflow version 2.0.2 does not 
appear to fix the issue and neither does version 2.1.0 or 2.1.4. I am uncertain 
of how the fix (https://github.com/apache/airflow/pull/14776) was shown as the 
key to fixing this.
   
   ### Are you willing to submit PR?
   
   - [X] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to