Handle graceful termination in microvm ateom - #893
Merged
Benjamin Elder (BenTheElder) merged 1 commit intoAug 17, 2026
Merged
Conversation
sfunkenhauser
force-pushed
the
ateom_gt_mvm
branch
3 times, most recently
from
August 12, 2026 20:21
a584eb0 to
d674bb8
Compare
sfunkenhauser
marked this pull request as ready for review
August 12, 2026 20:41
Collaborator
Author
|
Benjamin Elder (@BenTheElder) PTAL I've patched the e2e test fixes from #904 just to get a passing run, but will submit and rebase once that lands. |
Collaborator
|
that's in, taking a look at the other commit |
sfunkenhauser
force-pushed
the
ateom_gt_mvm
branch
from
August 13, 2026 11:49
d674bb8 to
3766157
Compare
sfunkenhauser
force-pushed
the
ateom_gt_mvm
branch
from
August 14, 2026 15:48
3766157 to
ac1e939
Compare
Collaborator
Author
Benjamin Elder (BenTheElder)
left a comment
Collaborator
There was a problem hiding this comment.
generally LGTM, will need a rebase
sfunkenhauser
force-pushed
the
ateom_gt_mvm
branch
from
August 17, 2026 16:25
ac1e939 to
64a764d
Compare
sfunkenhauser
force-pushed
the
ateom_gt_mvm
branch
from
August 17, 2026 16:33
64a764d to
fd2410d
Compare
Collaborator
Author
Benjamin Elder (BenTheElder)
approved these changes
Aug 17, 2026
Benjamin Elder (BenTheElder)
merged commit Aug 17, 2026
ea29390
into
agent-substrate:main
11 checks passed
This was referenced Aug 17, 2026
Benjamin Elder (BenTheElder)
added a commit
to BenTheElder/substrate
that referenced
this pull request
Aug 17, 2026
…ASHED The test deletes the worker pod, sleeps a fixed 2s, then suspends the actor, which is meant to land while the graceful shutdown is under way. On micro-VM it lands after the actor has already reached CRASHED, so the suspend is rejected and the test fails on every run since agent-substrate#893 enabled it there - on main as well as on unrelated PRs: termination_test.go: failed to suspend Actor: rpc error: code = FailedPrecondition desc = MarkSuspending prerequisite not met for Actor: demo/graceful-term-suspend-... (got: STATUS_CRASHED, want STATUS_RUNNING or STATUS_PAUSED) A duration is the wrong thing to wait on: how quickly the drain starts, and how long the actor survives it, differ by sandbox class. Wait for the state the test actually depends on instead - the control plane marking the worker DRAINING when it sees the pod's DeletionTimestamp - and suspend as soon as that is observable rather than 2s later. Measured against a kind cluster running this branch's main, micro-VM demo: before 0/3 pass, every failure the MarkSuspending rejection above after 14/15 pass; the one failure was elsewhere in the test (a resume readyz timeout, the pre-existing flake) and never the suspend The three termination tests also pass together, twice, with no skips. This keeps what the test is for. ateom's graceful shutdown deliberately releases its lock so 'a suspend arriving mid-drain' is still served, and that is what is being exercised; only the way the test finds that window changes.
2 tasks
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 #23
Trap SIGTERM in the ateom, and forward SIGTERM to all application containers.
Once all application containers exit, ateom will exit itself.