try_number
is incremented for Sensor Tasks in Reschedule Mode when using mysql database
#45366
Open
1 of 2 tasks
Labels
area:core
kind:bug
This is a clearly a bug
needs-triage
label for new issues that we didn't triage yet
provider:mysql
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.10.2
What happened?
Since 2.10, when running a sensor task in
mode=reschedule
, thetry_number
is incremented with each poke. This has a lot of task execution behavior implications such astry_number
is incrememnted with poke and will exceed max number of retries more quicklyFrom my testing this only occurs with
mysql
database. I have been unable to repro with sqlite in multiple environments.What you think should happen instead?
Sensors with
mode=reschedule
should only incrementtry_number
aftertimeout
has been reached or there is an error on execution.How to reproduce
Execute the following DAG in an airflow environment using
mysql
as the metadb. It will repeatedly run a sensor withmode=reschedule
. On theLogs
tab for the sensor task, you can verify that each poke is being broken out into its own log file and thattry_number
is being incrementedOperating System
Debian Slim-Buster
Versions of Apache Airflow Providers
Deployment
Other Docker-based deployment
Deployment details
No response
Anything else?
My best guess at this time is that the following
sqlalchemy
logic for checking if the state of the task isUP_FOR_RESCHEDULE
is not working as expected formysql
databases. We are hoping to find time to verify this is where the bug is occurring in the coming week.https://github.com/apache/airflow/blob/2.10.2/airflow/models/dagrun.py#L1612-L1623
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: