Skip to content

feat(orchestrator): count vanished workloads - #313

Open
morgan-wowk wants to merge 1 commit into
river-orchestrator-poll-failure-budgetfrom
vanished-pods-and-failed-launches
Open

feat(orchestrator): count vanished workloads#313
morgan-wowk wants to merge 1 commit into
river-orchestrator-poll-failure-budgetfrom
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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@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

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

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

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