github-actions[bot] opened a new pull request, #64693:
URL: https://github.com/apache/airflow/pull/64693

   * Return 410 Gone for heartbeat when TI was cleared and moved to TIH
   
   When a running task instance is cleared, its previous try is archived
   to the Task Instance History table and the TI receives a new UUID.
   Subsequent heartbeats from the old process get a 404 because the old
   UUID no longer exists in the TI table.
   
   This change improves the error handling by checking the TIH table when
   a heartbeat TI is not found. If the UUID exists in TIH, return 410
   Gone instead of 404 Not Found, giving the client a more specific
   signal that the task was cleared rather than never existing.
   
   - Server: check TIH on heartbeat NoResultFound, return 410 if found
   - Supervisor: handle 410 Gone same as 404/409 (terminate process)
   - Keep 404 for TIs that genuinely never existed
   
   closes: #53140
   
   * Update task_instances.py
   
   Co-authored-by: Amogh Desai <[email protected]>
   
   * Update task_instances.py
   
   Co-authored-by: Amogh Desai <[email protected]>
   
   * Update test_task_instances.py
   
   Co-authored-by: Amogh Desai <[email protected]>
   
   * fix(api): use task_instance_id in heartbeat 410 path and align detail 
message
   
   - Replace undefined ti_id_str with task_instance_id in TIH query and log
   - Use task_instance_id (UUID) for TIH.task_instance_id comparison
   - Set 410 Gone detail message to match test expectation
   
   ---------
   (cherry picked from commit ce1270b96fd22165f76e437d57eb812abb6691a3)
   
   Co-authored-by: AndrĂ© Ahlert <[email protected]>
   Co-authored-by: Amogh Desai <[email protected]>


-- 
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