-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic DAGs that disappear end up stuck in queued state. #15488
Comments
We are facing the same issue, I am using celery executor, upgraded to version 2.0.2 , tasks do not get executed. |
I reproduced this in 2.1.0 by removing a dag while it's queued. Set default pool to 9. from datetime import timedelta
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.dummy import DummyOperator
from airflow.utils.dates import days_ago
args = {
'owner': 'airflow',
}
with DAG(
dag_id='example_bash_operator',
default_args=args,
schedule_interval='0 0 * * *',
start_date=days_ago(2),
dagrun_timeout=timedelta(minutes=60),
params={"example_key": "example_value"},
) as dag:
run_this_last = DummyOperator(
task_id='run_this_last',
)
# [START howto_operator_bash]
run_this = BashOperator(
task_id='run_after_loop',
bash_command='echo 1',
)
# [END howto_operator_bash]
run_this >> run_this_last
for i in range(7):
task = BashOperator(
task_id='runme_' + str(i),
bash_command='echo "{{ task_instance_key_str }}" && sleep 30',
)
task >> run_this
# [START howto_operator_bash_template]
also_run_this = BashOperator(
task_id='also_run_this',
bash_command='echo "run_id={{ run_id }} | dag_run={{ dag_run }}"',
)
# [END howto_operator_bash_template]
also_run_this >> run_this_last
# [START howto_operator_bash_skip]
this_will_skip = BashOperator(
task_id='this_will_skip',
bash_command='echo "hello world"; exit 99;',
dag=dag,
)
# [END howto_operator_bash_skip]
this_will_skip >> run_this_last Notice that when you remove the dag, queued tasks remain queued and the executor fails.
I reproduced this with LocalExecutor. Just make sure you triggered the dag multiple times before removing the dag and you will reproduce this. If you trigger another different dag, nothing is executing. You will see this from the log:
This no longer happens in master because of this fix #15929.
And executor continues to execute other dags when triggered. |
@lukas-at-harren @alokgarg5 Can you try it with Master as suggested by @ephraimbuddy please and report back please if possible? |
Closed by #15929 and will be released in 2.1.3 |
I can observe the same problem with version 2.0.2:
My current remedy:
My desired solution:
When a DAG/task goes missing while it is queued, it should end up in a failed state.
Originally posted by @lukas-at-harren in #13542 (comment)
The text was updated successfully, but these errors were encountered: