stijndehaes commented on issue #16625:
URL: https://github.com/apache/airflow/issues/16625#issuecomment-896526055


   @ephraimbuddy I have found a way to consistently trigger the issue using the 
dag attached below.
   You first have to just let it run. It will nicely retry and be set to failed 
after trying twice.
   If you clear the task after that it will only try once instead of two times. 
Not 100% sure if it's the same issue though, but this one is also unexpected 
and at least is reproducable.
   
   ```
   import importlib
   from airflow import DAG
   from datetime import datetime, timedelta
   from kubernetes.client import models as k8s
   from airflow.operators.python import PythonOperator
   
   
   utils = importlib.import_module("sample-python.utils")
   
   default_args = {
       "start_date": datetime.now() - timedelta(days=2),
       "retries": 2,
       "retry_delay": timedelta(seconds=1),
   }
   
   sample_python_dag = DAG(
       "retry-failure",
       default_args=default_args,
       schedule_interval="@daily",
   )
   
   def my_func(ds, **kwargs):
       return ''
   
   PythonOperator(
       dag=sample_python_dag,
       task_id="task",
       python_callable=my_func,
       executor_config={
           "pod_override": k8s.V1Pod(
               spec=k8s.V1PodSpec(
                   containers=[
                       k8s.V1Container(
                           name="base",
                           command=["FailEarly"],
                       ),
                   ],
               )
           ),
       },
   )
   
   ```


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