Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ def _change_state(
namespace = results.namespace
failure_details = results.failure_details

termination_reason: str | None = None

if state == TaskInstanceState.FAILED:
# Use pre-collected failure details from the watcher to avoid additional API calls
if failure_details:
Expand All @@ -380,6 +382,8 @@ def _change_state(
container_type = failure_details.get("container_type")
container_name = failure_details.get("container_name")

termination_reason = f"Pod failed because of {pod_reason}"

task_key_str = f"{key.dag_id}.{key.task_id}.{key.try_number}"
self.log.warning(
"Task %s failed in pod %s/%s. Pod phase: %s, reason: %s, message: %s, "
Expand Down Expand Up @@ -447,7 +451,7 @@ def _change_state(
state = None
state = TaskInstanceState(state) if state else None

self.event_buffer[key] = state, None
self.event_buffer[key] = state, termination_reason

@staticmethod
def _get_pod_namespace(ti: TaskInstance):
Expand Down