Apache Airflow version
2.3.2 (latest released)
What happened
When deleting Dag Runs or DAGs from the UI, the response is HTTP ERROR 504 (timeout).
I believe it mainly happens because the delete process relies on the foreign key cascade effect.
After investigating the issue in the database (PostgreSQL), I suspect the problem is the locks on the xcom table.
I found that multiple delete operations are performed on the xcom table, regardless of whether the task returns a value.
Could it be that the Airflow code tries to delete the relevant xcom value for every task instance?
What you think should happen instead
UI should not timeout
How to reproduce
Try to delete a DAG or a DagRun from UI in a large deployment of Airflow (hundreds of DAGs, task instances, and xcom values).
Operating System
Ubuntu 20.04.3 LTS
Versions of Apache Airflow Providers
apache-airflow-providers-amazon @ apache_airflow_providers_amazon-4.0.0-py3-none-any.whl
apache-airflow-providers-ftp @ apache_airflow_providers_ftp-3.0.0-py3-none-any.whl
apache-airflow-providers-http @ apache_airflow_providers_http-3.0.0-py3-none-any.whl
apache-airflow-providers-imap @ apache_airflow_providers_imap-3.0.0-py3-none-any.whl
apache-airflow-providers-mongo @ apache_airflow_providers_mongo-3.0.0-py3-none-any.whl
apache-airflow-providers-mysql @ apache_airflow_providers_mysql-3.0.0-py3-none-any.whl
apache-airflow-providers-pagerduty @ apache_airflow_providers_pagerduty-3.0.0-py3-none-any.whl
apache-airflow-providers-postgres @ apache_airflow_providers_postgres-5.0.0-py3-none-any.whl
apache-airflow-providers-redis @ apache_airflow_providers_redis-3.0.0-py3-none-any.whl
apache-airflow-providers-sendgrid @ apache_airflow_providers_sendgrid-3.0.0-py3-none-any.whl
apache-airflow-providers-slack @ apache_airflow_providers_slack-5.0.0-py3-none-any.whl
apache-airflow-providers-sqlite @ apache_airflow_providers_sqlite-3.0.0-py3-none-any.whl
apache-airflow-providers-ssh @ apache_airflow_providers_ssh-3.0.0-py3-none-any.whl
apache-airflow-providers-vertica @ apache_airflow_providers_vertica-3.0.0-py3-none-any.whl
Deployment
Virtualenv installation
Deployment details
Python 3.8.10
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Apache Airflow version
2.3.2 (latest released)
What happened
When deleting Dag Runs or DAGs from the UI, the response is HTTP ERROR 504 (timeout).
I believe it mainly happens because the delete process relies on the foreign key cascade effect.
After investigating the issue in the database (PostgreSQL), I suspect the problem is the locks on the xcom table.
I found that multiple delete operations are performed on the xcom table, regardless of whether the task returns a value.
Could it be that the Airflow code tries to delete the relevant xcom value for every task instance?
What you think should happen instead
UI should not timeout
How to reproduce
Try to delete a DAG or a DagRun from UI in a large deployment of Airflow (hundreds of DAGs, task instances, and xcom values).
Operating System
Ubuntu 20.04.3 LTS
Versions of Apache Airflow Providers
Deployment
Virtualenv installation
Deployment details
Python 3.8.10
Anything else
No response
Are you willing to submit PR?
Code of Conduct