Skip to content

ateapi: classify atelet churn as Unavailable - #710

Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-646-atelet-unavailable
Open

ateapi: classify atelet churn as Unavailable#710
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-646-atelet-unavailable

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown

Summary

When the atelet DaemonSet pod on a node is being replaced (routine during node upgrades), DialForWorker fails with a plain fmt.Errorf, so the interceptor defaults it to codes.Internal — clients are told not to retry an error that self-heals in seconds (#646). The two transient paths (atelet pod count ≠ 1, no assigned IPs) now return codes.Unavailable: the interceptor extracts the code through %w wrapping, the router parks and retries per docs/request-parking.md, and unrecoverable cases surface as 503 with Retry-After: 1 (added to the router's immediate responses, 503 only).

Scope, per #646's own dedup notes: worker-pod-side lookups ("expected 1 pod match") stay as-is (#600's territory), credential/connection build failures remain Internal, and the full workflow-step audit is the inverse direction of #605.

Fixes #646

Test plan

  • dialer: fake-informer scenarios (zero atelets, two atelets, atelet without IPs) assert Unavailable; a wrapping test asserts the code survives fmt.Errorf("...: %w", err) as the workflows wrap it; ErrWorkerPodNotFound sentinel unaffected
  • router: retry-after: 1 present on 503 immediate responses, absent on 500/504/403; RawValue encoding pinned

DialForWorker's transient failures (atelet pod being replaced, IP not
yet assigned) surfaced as the interceptor's Internal default, telling
clients not to retry an error that self-heals in seconds. Unavailable
lets the router park and retry; its 503s now carry Retry-After: 1.

Worker-pod-side lookups keep their current classification (agent-substrate#600), and
a full workflow-step audit is agent-substrate#605's inverse direction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant