Fix KubernetesExecutor retry losing hostname#67372
Open
kalluripradeep wants to merge 1 commit into
Open
Conversation
kalluripradeep
added a commit
to kalluripradeep/airflow
that referenced
this pull request
May 23, 2026
82ab137 to
f956372
Compare
closes: apache#65366 closes: apache#67238
7d3f9d0 to
190c0b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #65366
closes: #67238
What happened?
When a task instance using KubernetesExecutor (or CeleryExecutor) fails from a non-
RUNNINGstate (e.g.QUEUED,DEFERRED, or killed externally), the task attempt is retried, but theTaskInstanceHistoryrecord is not properly saved because the history logic incorrectly assumed onlyRUNNINGtasks need their execution history recorded. This resulted in the failure attempt losing its hostname and execution metadata, leading to thehttp://:8793 No host suppliederror when retrieving logs in the UI.What changed?
TaskInstanceHistorycreation to force the state toFAILEDand populateend_dateanddurationif the task fails from a non-finished state.task_instances.pyExecution API logic to correctly update the task instance payload (includingend_dateandrendered_map_index) when transitioning to a retry state beforeprepare_db_for_next_tryclears the metadata.TaskInstanceHistorycorrectly captures the hostname and other attempt metadata when a task fails and retries.