feat(k8s-launcher): explain empty logs when a pod was deleted before capture - #326
Closed
morgan-wowk wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
morgan-wowk
force-pushed
the
08-12-fix_orchestrator_losing_pod_logs_must_not_fail_an_execution
branch
from
August 12, 2026 20:29
9802c98 to
b2bdd00
Compare
morgan-wowk
force-pushed
the
08-12-feat_k8s-launcher_explain_empty_logs_when_a_pod_was_deleted_before_capture
branch
2 times, most recently
from
August 12, 2026 20:49
520f54f to
f702c27
Compare
morgan-wowk
marked this pull request as ready for review
August 12, 2026 20:49
morgan-wowk
changed the base branch from
08-12-fix_orchestrator_losing_pod_logs_must_not_fail_an_execution
to
graphite-base/326
August 13, 2026 01:45
morgan-wowk
force-pushed
the
08-12-feat_k8s-launcher_explain_empty_logs_when_a_pod_was_deleted_before_capture
branch
from
August 13, 2026 01:45
f702c27 to
3c14f2f
Compare
morgan-wowk
force-pushed
the
graphite-base/326
branch
from
August 13, 2026 01:45
b2bdd00 to
1b3e614
Compare
…capture Signed-off-by: Morgan Wowk <morgan.wowk@shopify.com>
morgan-wowk
force-pushed
the
08-12-feat_k8s-launcher_explain_empty_logs_when_a_pod_was_deleted_before_capture
branch
from
August 13, 2026 01:45
3c14f2f to
a6b2d5b
Compare
Ark-kun
reviewed
Aug 13, 2026
| # Persisted in place of an empty log when the only reason no logs were captured | ||
| # is that the Pod(s) were deleted before we could read them -- e.g. the | ||
| # cluster-autoscaler evicting the node, or Kubernetes garbage-collecting a | ||
| # finished Pod. Without this the UI shows a blank pane indistinguishable from a |
Contributor
There was a problem hiding this comment.
The distinction between "empty log" and "missing log" can/should be done on the UI side.
The APi already returns log_text: "" vs log_text: undefined. If get_log returns None, the log_text is undefined. See
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.

Stacked on #325.
What this closes
#325 stops a deleted pod from turning
FAILEDintoSYSTEM_ERROR. But it trades a loud-wrong-status for a silent blank: with the pod gone,_get_all_logs()recovers nothing,upload_log()persists an empty log, and the runs v2 page renders the bare text "No logs available" — indistinguishable from a task that simply produced no output. The Job launcher also can't help:launcher_error_messageis an unimplementedreturn None, so noorchestration_error_messageis recorded either.New rules
A vanished pod is reported as deleted, not as "no log yet".
_get_log_by_pod_keynow returns a_POD_DELETEDsentinel on a404, distinct fromNone(pod exists, HTTP 400, still initializing)._get_all_logsreturns(logs, deleted_pod_keys)so callers can tell the two apart.When a deleted pod is the only reason there are no logs, the persisted log is an explanatory notice instead of an empty string:
This flows straight into the existing log pane (the runs v2 page reads the persisted artifact for terminal executions) with no frontend change.
The notice never masks a real result. It is substituted only when the merged log is empty and at least one pod
404'd. A pod that still exists and printed nothing stays empty; any recovered logs (even partial, when only some pods vanished) are persisted verbatim.Why a pod vanishes before capture
Two independent causes, both seen in practice: the cluster-autoscaler evicting the node mid-run, and Kubernetes garbage-collecting a finished pod before the orchestrator reads it. Both surface identically as a
404onread_namespaced_pod_log.Tests
tests/test_kubernetes_launcher_error_classification.py:_get_log_by_pod_keyreturns the_POD_DELETEDsentinel on404(still raises on403/500).upload_log/get_logpersist the notice when the pod was deleted, keep an existing pod's empty output empty, and leave recovered (partial) logs untouched.uv run pytest).Downstream
Shopify/oasis-backend pins this repo as the
backendsubmodule; picking this up needs a submodule pointer bump (together with #325).