tirkarthi opened a new issue, #41765:
URL: https://github.com/apache/airflow/issues/41765

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   While trying out a task with high number of retries I noticed the issue 
where there are duplicate entries for task tries sometimes but eventually 
resolves it by itself. I noticed the following query where TaskInstanceHistory 
and TaskInstance entry is combined. There could be a case where the max 
try_number of TaskInstanceHistory  entries and TaskInstance's try_number are 
the same thus leading to the duplicate entries in the latest try.
   
   
   
https://github.com/apache/airflow/blob/79db243d03cc4406290597ad400ab0f514975c79/airflow/api_connexion/endpoints/task_instance_endpoint.py#L863-L872
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   1. Setup a dag with high number of retries.
   2. Notice occassionally the below scenario during API calls with duplicate 
response for the last try number.
   
   
![image](https://github.com/user-attachments/assets/4d276275-5331-476f-9261-eb842c67f719)
   
   
   ### Operating System
   
   Ubuntu
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to