You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "amoghrajesh (via GitHub)" <gi...@apache.org> on 2025/07/10 14:15:52 UTC

[I] Better error handling for running ti heartbeats after task is cleared [airflow]

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

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When a running TI is cleared, it is immediately removed from the ti table and moved to TIH. This causes subsequent heartbeats from the running TI to receive a 404 (Not Found) from the API server.
   
   As a result, the client (worker/task) logs a misleading error like: "TaskInstance not found", despite it being alive.
   
   ### What you think should happen instead?
   
   Instead of a 404, the API should handle this more gracefully by checking TIH when a TI is not found in TI.
   
   ### How to reproduce
   
   1. Start a task
   2. Clear it while running
   3. Observe 404 errors from heartbeat API calls and the "TaskInstance not found" message.
   
   ### Operating System
   
   MacOS
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] 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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Better error handling for running ti heartbeats after task is cleared [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on issue #53140:
URL: https://github.com/apache/airflow/issues/53140#issuecomment-3134944219

   I will pick this issue up today/tomorrow.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Better error handling for running ti heartbeats after task is cleared [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl closed issue #53140: Better error handling for running ti heartbeats after task is cleared
URL: https://github.com/apache/airflow/issues/53140


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Better error handling for running ti heartbeats after task is cleared [airflow]

Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on issue #53140:
URL: https://github.com/apache/airflow/issues/53140#issuecomment-3371958210

   @kriti-sc Yes, good shout, 410 Gone is a much better idea.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Better error handling for running ti heartbeats after task is cleared [airflow]

Posted by "kriti-sc (via GitHub)" <gi...@apache.org>.
kriti-sc commented on issue #53140:
URL: https://github.com/apache/airflow/issues/53140#issuecomment-3368824571

   I think the endpoint should return a `410 - gone` instead of 404.
   
   The endpoint in question -- when it finds the task isntance in the TI table, it goes on to update the `last_heartbeat_at` field for that task instance. We don't want to do this for a task instance that has been moved to the TIH (we also cannot because the field does not exist in the TIH) 
   
   Let me know @amoghrajesh @ashb 
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org