GitHub user borisovpavl73 created a discussion: Strange behavior of Local 
executor

Hi!

Running airflow standalone ver 3.0.4 in WSL2 on Windows11.

With this example of code i want to watch how Airflow can control order of task 
execution.

```
import pendulum
from airflow import DAG
from airflow.providers.standard.operators.python import PythonOperator


def tst_func(name):
    print(f"hello from task {name}")

with DAG(
        'dag_tst_tasks',
        schedule='@daily',
        start_date=pendulum.now().add(days=-1),
) as dag:

    t1 = PythonOperator(
        task_id="t1",
        python_callable=tst_func,
        op_kwargs={"name": 1}
    )

    t2 = PythonOperator(
        task_id="t2",
        python_callable=tst_func,
        op_kwargs={"name": 2}
    )

    t3 = PythonOperator(
        task_id="t3",
        python_callable=tst_func,
        op_kwargs={"name": 3}
    )

    t4 = PythonOperator(
        task_id="t4",
        python_callable=tst_func,
        op_kwargs={"name": 4}
    )

    t5 = PythonOperator(
        task_id="t5",
        python_callable=tst_func,
        op_kwargs={"name": 5}
    )


    t6 = PythonOperator(
        task_id="t6",
        python_callable=tst_func,
        op_kwargs={"name": 6}
    )

    t3 >> [t4, t6, t2] >> t1
    t3 >> t5

```

But for strange reasons this dag can get failed status from time to time with 
error:
> Executor LocalExecutor(parallelism=32) reported that the task instance 
> <TaskInstance: dag_tst_tasks.t3 manual__2025-09-09T10:57:35.672635+00:00 
> [queued]> finished with state failed, but the task instance's state attribute 
> is queued. Learn more: 
> https://airflow.apache.org/docs/apache-airflow/stable/troubleshooting.html#task-state-changed-externally

In screenshots you may see that it can failed in first task or last
<img width="1306" height="273" alt="Снимок экрана 2025-09-09 135819" 
src="https://github.com/user-attachments/assets/2884f4bc-4a7b-4cc2-b3e8-7965936d3acf";
 />
<img width="1358" height="461" alt="Снимок экрана 2025-09-09 135842" 
src="https://github.com/user-attachments/assets/a92d77e4-5a69-428b-b954-f932abeb6163";
 />

If i delete parallel task execution and run tasks sequentially, all tasks 
completed successfully. 
Can someone explain why it is happening? Is it because i used default local 
executor and standalone version?

GitHub link: https://github.com/apache/airflow/discussions/55413

----
This is an automatically sent email for comm...@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscr...@airflow.apache.org

Reply via email to