GitHub user pavelpi added a comment to the discussion: KubernetesPodOperator
finishes despite marked as failed
Thanks @potiuk for quick reply!
I was actually able to reproduce this behavior with python operator that just
waits for 30s. If you mark it as failed from UI, it is marked red, it still
works in the background and once you refresh the frontend in 30s, the task is
showed as green.
So the assumption is that this is generic Airflow feature - it does not stop
running tasks when you mark them as failed on UI.
for reference this is the DAG:
```python
from datetime import datetime
from airflow.operators.python import PythonOperator
from airflow import DAG
import time
def wait_callable():
for i in range(1, 30):
print(f'sleep #{0}', i)
time.sleep(1)
default_args = {
'owner': 'airflow',
'start_date': datetime(2020, 3, 4)
}
dag = DAG("wait_dag_python",
default_args=default_args,
schedule=None)
wait_task = PythonOperator(
task_id='wait_task',
python_callable=wait_callable,
dag=dag
)
```
the logfile shows printed line every 1s regardless if you fail the task or not.
Is there any way how to terminate the task when I fail it from UI manually?
GitHub link:
https://github.com/apache/airflow/discussions/45830#discussioncomment-11905416
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]