Skip to content

feat(orchestrator): count vanished workloads - #313

Merged
morgan-wowk merged 1 commit into
masterfrom
vanished-pods-and-failed-launches
Aug 11, 2026
Merged

feat(orchestrator): count vanished workloads#313
morgan-wowk merged 1 commit into
masterfrom
vanished-pods-and-failed-launches

Conversation

@morgan-wowk

@morgan-wowk morgan-wowk commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

What

Adds one counter, execution.missing_workloads, incremented when refreshing a running container fails because the workload no longer exists — it is gone, not merely unobservable.

The counter is labelled with the status the container was in when it vanished (RUNNING vs PENDING), since workloads killed mid-run and workloads that never started usually have different root causes.

Consistent with the launcher/orchestrator boundary, the Kubernetes launcher maps a 404 to a typed LaunchedContainerNotFoundError; the orchestrator counts that typed error without inspecting HTTP status codes.

Why

In one recent 17h production window, vanished workloads accounted for 162 of 255 orchestrator SYSTEM_ERRORs. This makes that slice measurable.

Scope

Observability only. A not-found error is non-retriable, so the execution still terminalizes as SYSTEM_ERROR exactly as before — no change to verdicts or pipeline semantics.

morgan-wowk commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@morgan-wowk
morgan-wowk force-pushed the vanished-pods-and-failed-launches branch from dc8fe83 to a4afac0 Compare August 6, 2026 19:16
@morgan-wowk morgan-wowk changed the title fix(orchestrator): resolve vanished pods and failed launches correctly feat(orchestrator): count vanished-pod poll failures Aug 6, 2026
@morgan-wowk
morgan-wowk force-pushed the vanished-pods-and-failed-launches branch from a4afac0 to c2bec2c Compare August 6, 2026 19:25
@morgan-wowk
morgan-wowk marked this pull request as ready for review August 6, 2026 19:35
@morgan-wowk
morgan-wowk requested a review from Ark-kun as a code owner August 6, 2026 19:35
)

execution_missing_workloads = orchestrator_meter.create_counter(
name="execution.missing_workloads",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively poll.missing_workloads
Name suggestions welcome.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, but maybe:
execution -> container_execution (to disambiguate from execution_node)
missing workloads is OK. Alternatives:
missing_launched_containers
disappeared_launched_containers
launched_container_not_found_errors

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept execution.missing_workloads to stay consistent with its sibling counter execution.system_errors (and execution.status_transition.duration). Happy to move the whole execution.* family to container_execution.* in a separate pass if you'd prefer the disambiguation across the board.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adopted this — renamed to container_execution.missing_workloads (and the variable to container_execution_missing_workloads), and updated the description to say "container executions" to match. Thanks!

@@ -1,4 +1,5 @@
import copy
import http

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Red flag. Orchestrator is not dependent on/tied to HTTP.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — http is no longer imported by the orchestrator; the only http usage lives in the Kubernetes launcher's _launcher_error_from_api_exception. The orchestrator acts purely on the typed LaunchedContainerNotFoundError.

return status is not None and 500 <= status < 600


def _is_missing_workload_failure(exception: BaseException) -> bool:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too Kubernetes launcher specific and does not belong to Orchestrator.

Options:

  • Move this tracking to kubernetes_laucnhers
  • Create a LaunchedContainerNotFoundError exception that derives from ContainerLauncherError and then handle it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented the latter. Thank you!

@morgan-wowk
morgan-wowk force-pushed the river-orchestrator-poll-failure-budget branch from c3a74c9 to 6d972ae Compare August 6, 2026 22:49
@morgan-wowk
morgan-wowk force-pushed the vanished-pods-and-failed-launches branch from c2bec2c to eaf6fec Compare August 6, 2026 22:49
@morgan-wowk morgan-wowk changed the title feat(orchestrator): count vanished-pod poll failures feat(orchestrator): count vanished workloads Aug 6, 2026
@morgan-wowk
morgan-wowk force-pushed the vanished-pods-and-failed-launches branch from eaf6fec to 90206b6 Compare August 6, 2026 23:21
@morgan-wowk
morgan-wowk force-pushed the river-orchestrator-poll-failure-budget branch from 6d972ae to 8e67db9 Compare August 6, 2026 23:21
)

execution_missing_workloads = orchestrator_meter.create_counter(
name="execution.missing_workloads",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, but maybe:
execution -> container_execution (to disambiguate from execution_node)
missing workloads is OK. Alternatives:
missing_launched_containers
disappeared_launched_containers
launched_container_not_found_errors

@morgan-wowk
morgan-wowk force-pushed the river-orchestrator-poll-failure-budget branch from 8e67db9 to 1c961ba Compare August 11, 2026 23:03
@morgan-wowk
morgan-wowk force-pushed the vanished-pods-and-failed-launches branch from 90206b6 to f821413 Compare August 11, 2026 23:03
@morgan-wowk
morgan-wowk force-pushed the river-orchestrator-poll-failure-budget branch from 1c961ba to da47a47 Compare August 11, 2026 23:24
@morgan-wowk
morgan-wowk force-pushed the vanished-pods-and-failed-launches branch 2 times, most recently from 4c670d6 to 66caa54 Compare August 11, 2026 23:35

morgan-wowk commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Aug 11, 11:45 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 11, 11:47 PM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 11, 11:47 PM UTC: @morgan-wowk merged this pull request with Graphite.

@morgan-wowk
morgan-wowk changed the base branch from river-orchestrator-poll-failure-budget to graphite-base/313 August 11, 2026 23:45
@morgan-wowk
morgan-wowk changed the base branch from graphite-base/313 to master August 11, 2026 23:45
@morgan-wowk
morgan-wowk requested a review from a team August 11, 2026 23:45
When refreshing a running container fails because the workload no longer
exists, that is a definitive failure -- the workload is gone rather than
merely unobservable -- and it is worth watching on its own. The Kubernetes
launcher now maps a 404 to a typed `LaunchedContainerNotFoundError`, and the
orchestrator counts it on a dedicated counter, `execution.missing_workloads`,
labelled with the status the container was in when it vanished (RUNNING vs
PENDING usually point at different culprits: workloads killed mid-run vs
workloads that never started).

Deciding that a 404 means "gone" is the launcher's job, not the orchestrator's:
the orchestrator acts on the typed error without inspecting HTTP status codes,
staying free of platform specifics.

This is observability only. A not-found error is non-retriable, so the
execution terminalizes as SYSTEM_ERROR exactly as before -- no change to
verdicts or pipeline semantics.

Co-authored-by: Morgan Wowk <morgan.wowk@shopify.com>
@morgan-wowk
morgan-wowk force-pushed the vanished-pods-and-failed-launches branch from 66caa54 to a9f9584 Compare August 11, 2026 23:46
@morgan-wowk
morgan-wowk merged commit 0c6f8f7 into master Aug 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants