Repository navigation
Move WorkerPoolSyncer to ate-controller - #1203
Merged
Julian Gutierrez Oschmann (juli4n) merged 2 commits intoAug 26, 2026
Merged
Julian Gutierrez Oschmann (juli4n) merged 2 commits into
Julian Gutierrez Oschmann (juli4n) merged 2 commits into
Conversation
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker_pool_syncer_migrate
branch
3 times, most recently
from
August 25, 2026 19:36
fe23b1a to
a599098
Compare
Scott Funkenhauser (sfunkenhauser)
marked this pull request as ready for review
August 25, 2026 20:25
Scott Funkenhauser (sfunkenhauser)
requested a review
from Julian Gutierrez Oschmann (juli4n)
August 25, 2026 20:25
| // | ||
| // A concurrent SuspendActor or ResumeActor wins the optimistic version check; | ||
| // this attempt fails as ABORTED so the caller retries against the newer state. | ||
| func (s *RPCService) releaseActorOnDeadWorker(ctx context.Context, worker *ateapipb.Worker) error { |
Collaborator
There was a problem hiding this comment.
Should we move this into a DeleteWorker workflow? That would be consistent with other RPC handlers that need to orchestrate an idempotent sequence of steps.
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker_pool_syncer_migrate
branch
from
August 26, 2026 14:52
a599098 to
68deb82
Compare
Scott Funkenhauser (sfunkenhauser)
force-pushed
the
worker_pool_syncer_migrate
branch
from
August 26, 2026 15:11
68deb82 to
08c59b0
Compare
Julian Gutierrez Oschmann (juli4n)
approved these changes
Aug 26, 2026
Julian Gutierrez Oschmann (juli4n)
merged commit Aug 26, 2026
37735a6
into
agent-substrate:main
9 checks passed
This was referenced Aug 26, 2026
Aditya Shantanu (aditya-shantanu)
added a commit
to aditya-shantanu/substrate
that referenced
this pull request
Aug 26, 2026
Workers were registered as soon as their pod had an IP, which is long before ateom's gRPC server can accept a ResumeActor - the scheduling half of the ateom startup race in agent-substrate#1106. Registration now additionally requires PodReady=True, backed by a real readiness signal: ateom serves HTTP /readyz on a dedicated port (8080) once its gRPC server is up, and flips it to 503 on SIGTERM so a draining worker stops receiving work before the sandbox teardown begins. The worker Deployment probes that endpoint instead of TCP-probing the TLS port, which also removes the handshake-error log spam every probe period. Eligibility only gates registration: an already-registered worker is not deregistered by a readiness flap, so bound actors ride out probe blips; pinned by TestSyncer_ReadinessFlapDoesNotDeregister. A readiness server that cannot come up exits the process: the pod would otherwise look alive while never turning Ready and never receiving work. Takes over agent-substrate#1107; test fixtures updated for the syncer's move to cmd/atecontroller/internal/workersync (agent-substrate#1203).
Scott Funkenhauser (sfunkenhauser)
pushed a commit
that referenced
this pull request
Aug 26, 2026
Fixes #1106. Takes over #1107 (adopting @Stevenjin8's approach and commits from that PR — credit to him for the design; trailer omitted only for CLA) and incorporates the review feedback it accumulated. Workers were registered as schedulable the moment their pod had an IP — long before ateom's gRPC server was listening, which is the scheduling race in #1106 (actors dispatched to a cold ateom fail at dial time). Now: - ateom (gvisor + microvm) serves HTTP `/readyz` on a dedicated port (8080) once its gRPC listener is up, flipping to 503 on SIGTERM so draining workers stop receiving work. - The worker Deployment probes that endpoint (replaces the earlier TCP probe against the TLS port, which spammed handshake errors). - `isWorkerEligible` requires `PodReady=True` in addition to an IP. Eligibility gates **registration only** — a readiness flap never deregisters a worker with a bound actor (pinned by `TestSyncer_ReadinessFlapDoesNotDeregister`). - A readiness server that cannot come up exits the process rather than leaving a pod that looks alive but can never receive work. Beyond #1107's head: dropped the pre-migration `controlapi/syncer_test.go` copy (didn't compile after #1203 moved the syncer), fixed the `workersync` fixtures for the new gate, and added `TestSyncer_PodWithIPButNotReadyIsNotRegistered` (+ the flap test above). ## Testing - `go test ./...`: green, zero failures. - `-race -count=10` on `workersync` + `serverboot`, `-race -count=5` on `controllers`, `-race` on all of `controlapi` incl. functional tests: green. - Green under a hostile ambient env (`KUBECTL_CONTEXT`/`KO_DOCKER_REPO`/`PROJECT_ID` set to garbage). ## Scope notes - The one post-#1160 failure with a *post-restore* signature (run 32891995583: restored actor's own container `/healthz` timing out, actor stuck RESUMING) is a different layer — ateom was demonstrably serving — and is **not** claimed as fixed here. If it recurs, it deserves its own issue. (The other suspected post-merge failure, run 32911674788, turned out to be that PR's own x509 regression, not this flake.) - Mixed-version caveat: this controller pointed at pods running a pre-readyz ateom image leaves those workers unready/unregistered. The supported install flows build both from the same source, so this only matters for hand-rolled skew. - [x] Tests pass - [x] Appropriate changes to documentation are included in the PR Co-authored-by: Aditya Shantanu <[email protected]>
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.
Fixes #729