amoghrajesh commented on code in PR #56443:
URL: https://github.com/apache/airflow/pull/56443#discussion_r2513004087


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -605,12 +605,12 @@ def ti_heartbeat(
             "Retrieved current task state", state=previous_state, 
current_hostname=hostname, current_pid=pid
         )
     except NoResultFound:
-        log.error("Task Instance not found")
+        status.HTTP_410_GONE: {"description": "Task Instance no longer exists, 
it may have moved to the Task Instance History table"},

Review Comment:
   I think we should actually validate that, check if it is present in the TIH 
table.
   
   Two situations possible here:
   
   1. Task Instance doesnt exist and not in TIH table -> return 404
   2. Task Instance doesnt exist and present in TIH table -> return 410



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