max_active_tis_per_dag not working in Deferrable Operator #44196
Labels
area:async-operators
AIP-40: Deferrable ("Async") Operators
area:core
kind:bug
This is a clearly a bug
needs-triage
label for new issues that we didn't triage yet
provider:databricks
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.7.2
What happened?
When using DatabricksRunNowOperator with deferrable set to True, option max_active_tis_per_dag is not limiting number of concurrent tasks run.
What you think should happen instead?
When you set max_active_tis_per_dag, Airflow should ensure that:
(the count of running and queued tasks) <= max_active_tis_per_dag
no matter if used with deferrable, or non-defferable setting.
However this is takes effect only for non-defferable, for deferrable operator/setting it is not not limiting number of concurrent tasks run.
How to reproduce
I believe this is the case for all of the defferable-Operators. However I only tried with DatabricksRunNowOperator.
In order to reproduce just use defferable-operator with dynamically created tasks with max_active_tis_per_dag set to 1.
When used with DatabricksRunNowOperator it will create many run of tasks (in Airflow and in Databricks).
You can use below code for dag
Operating System
macOS
Versions of Apache Airflow Providers
apache_airflow-2.7.3
apache_airflow_providers_databricks-4.6.0
Deployment
Amazon (AWS) MWAA
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: