Repository navigation
Detect worker restarts by an epoch the worker process registers - #2988
Merged
Julian Gutierrez Oschmann (juli4n) merged 1 commit intoOct 22, 2026
Conversation
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker-restart-epoch
branch
2 times, most recently
from
October 20, 2026 19:27
3ad497f to
2c4c91c
Compare
Scott Funkenhauser (sfunkenhauser)
marked this pull request as ready for review
October 20, 2026 19:32
Benjamin Elder (BenTheElder)
left a comment
Collaborator
There was a problem hiding this comment.
first pass is an agent-bug hunt and an overview on my part, I think this high level design makes sense, attaching findings.
also I think we have credible options to close the remaining gaps.
need to put more time on the APIs, poked Julian Gutierrez Oschmann (@juli4n) Tim Hockin (@thockin)
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker-restart-epoch
branch
2 times, most recently
from
October 21, 2026 15:59
ced4928 to
1587d9f
Compare
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker-restart-epoch
branch
from
October 21, 2026 20:12
1587d9f to
2f4008b
Compare
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker-restart-epoch
branch
from
October 21, 2026 20:35
2f4008b to
12d84e5
Compare
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker-restart-epoch
branch
from
October 21, 2026 21:24
12d84e5 to
3f8c133
Compare
Julian Gutierrez Oschmann (juli4n)
previously approved these changes
Oct 21, 2026
Julian Gutierrez Oschmann (juli4n)
left a comment
Collaborator
There was a problem hiding this comment.
Needs rebase
Restart detection relied on the worker container's restartCount, which can restart from zero or stay the same. It was also recorded at bind time, so a resume whose Restore reached the restarted process was later crashed as if its sandbox had been lost. Each worker process now acquires an epoch from ateapi and activates it with RegisterWorker, once, along with its pod IPs and capacity. Sandbox runtimes move to SetWorkerSandboxRuntimes. Run and Restore return the worker's epoch, and finalizeRunning records it, or returns Unavailable. A worker refuses workloads with Unavailable until it registers, and atelet passes a worker's Unavailable on, so the resume is retried rather than the actor crashed. The reconciler crashes actors recorded below the active epoch, and leaves RESUMING actors and claims never committed to an actor alone. A worker reports ready only once registered. Worker.ips moves to status.ips and follows a recreated pod sandbox. Not handled yet: a worker that crashes before registering leaves its lost actors RUNNING.
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker-restart-epoch
branch
from
October 22, 2026 12:04
3f8c133 to
fbffd6f
Compare
Julian Gutierrez Oschmann (juli4n)
approved these changes
Oct 22, 2026
2 tasks done
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.
Restart detection relied on the worker container's restartCount, which can restart from zero or stay the same. It was also recorded at bind time, so a resume whose Restore reached the restarted process was later crashed as if its sandbox had been lost.
Each worker process now acquires an epoch from ateapi and activates it with RegisterWorker, once, along with its pod IPs and capacity. Sandbox runtimes move to SetWorkerSandboxRuntimes. Run and Restore return the worker's epoch, and finalizeRunning records it, or returns Unavailable. A worker refuses workloads with Unavailable until it registers, and atelet passes a worker's Unavailable on, so the resume is retried rather than the actor crashed. The reconciler crashes actors recorded below the active epoch, and leaves RESUMING actors and claims never committed to an actor alone. A worker reports ready only once registered. Worker.ips moves to status.ips and follows a recreated pod sandbox.
Not handled yet: a worker that crashes before registering leaves its lost actors RUNNING.
Fixes #2692
Fixes #1837
AI use: AI-assisted, I reviewed and tested it.