Add DialForNode and always finalize in FinalizeSuspendedStep - #813
Merged
Julian Gutierrez Oschmann (juli4n) merged 1 commit intoAug 8, 2026
Conversation
Haven Xia (HavenXia)
previously approved these changes
Aug 8, 2026
Dmitry Berkovich (dberkov)
force-pushed
the
dial-for-node-and-finalize-refactor
branch
from
August 8, 2026 19:29
53dd130 to
b5814ff
Compare
Two behavior-preserving refactors needed to suspend a PAUSED actor (agent-substrate#791), which has no worker assignment: - Dialer: extract dialAteletOnNode from DialForWorker and expose DialForNode for actors whose state is pinned to a node without a worker (a PAUSED actor's local snapshot). A node with no atelet returns the new retryable sentinel ErrNoAteletOnNode, distinct from the crash-worthy ErrWorkerPodNotFound. - FinalizeSuspendedStep: hoist finalization (ActorSnapshot record, SUSPENDED flip, clearing in-progress fields) out of the worker-freeing branch so it runs even with no assignment. Previously such an actor was silently left SUSPENDING while the workflow reported success; unreachable today because CallAteletSuspendStep crashes nil-assignment actors first, but load-bearing for the paused-origin path. Part of agent-substrate#791
Dmitry Berkovich (dberkov)
force-pushed
the
dial-for-node-and-finalize-refactor
branch
from
August 8, 2026 19:35
b5814ff to
ddb2211
Compare
Collaborator
|
LGTM. Needs rebase. |
Julian Gutierrez Oschmann (juli4n)
approved these changes
Aug 8, 2026
Julian Gutierrez Oschmann (juli4n)
merged commit Aug 8, 2026
231a9ef
into
agent-substrate:main
11 checks passed
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.
Part of #791 (PR 3 of the implementation plan).
Two behavior-preserving refactors needed before suspending a PAUSED actor, which has no worker assignment:
Dialer — extract
dialAteletOnNodefromDialForWorker's tail (byNode index lookup → single-atelet check → per-pod-UID connection cache → pinned-mTLS dial) and exposeDialForNode(nodeName)for actors whose state is pinned to a node without a worker pod (a PAUSED actor's local snapshot). A node with no atelet in the informer cache returns the new sentinelErrNoAteletOnNode— documented as retryable (atelet restarting / informer lag), distinct from the crash-worthyErrWorkerPodNotFound.DialForWorkerbehavior is unchanged apart from error wrapping in the zero-atelets case.FinalizeSuspendedStep — hoist finalization (ActorSnapshot record,
LatestSnapshot, theSUSPENDEDflip, clearingInProgressSnapshot/WorkerAssignment/LocalSnapshotInfo) out of theif assignment != nilworker-freeing branch so it always runs. Previously, a SUSPENDING actor with no assignment was silently skipped — the workflow reported success while the actor stayed SUSPENDING forever. Unreachable today (CallAteletSuspendStep's prerequisite crashes nil-assignment actors first), but load-bearing for the paused-origin suspend, where no worker exists by design.Tests:
TestDialForNode: no atelet on node →ErrNoAteletOnNode; two atelets → error; happy path asserts pod-UID-pinned credentials and connection caching.TestFinalizeSuspendedStep_NoAssignment: SUSPENDING actor withLocalSnapshotInfoand an in-progress URI but no assignment → SUSPENDED, ActorSnapshot created at the URI,LatestSnapshotset, in-progress fields andLocalSnapshotInfocleared.go test -race ./cmd/ateapi/...(incl. the functional suite covering the running-path suspend end-to-end),go vet,gofmtclean. Independent of #810 and #812.🤖 Generated with Claude Code