Repository navigation
Backlog
Milestone
Description
Today
ax-server hands work to a runner in two steps.
- It POSTs a Task to
/runner/v1alpha1/task, or a Workspace to/runner/v1alpha1/setup(pushToRunnerininternal/controller/actorhttp.go). The handler ininternal/metadata/server.go(handleTaskPush,handleSetupPush) puts the work on an internal channel,pushes, and replies202at once. runPushedinrunner/runner.goreceives the work fromPushes(), sets up the workspace and starts the task, and records the result withSetWorkspaceCheckReadyorSetSetupFailed. ax-server learns the result by pollingGET /readyz?check=workspaceevery 500 ms (waitWorkspaceReady):503while the work is pending,200once it is done, and500with the reason when it failed.
So the reply to a push says only that the work was queued. Its result travels through a second endpoint, and through extra state in the metadata server.
Proposal
A push should not return until the pushed work is complete: the workspace is set up and, for a task, its command has started. The reply is the result: 200 on success and 500 with the reason on failure, with 409 and 400 as they are today.
The metadata server then has no work to queue:
- Delete the
pusheschannel,Pushes()and thePushtype. The handler runs the work itself, through a function the runner gives the server, or the runner serves these two endpoints. runPushedloses its receive loop.- ax-server stops polling
/readyz?check=workspaceafter a push.waitWorkspaceReadycan go, and so canworkspaceCheckReady,setupFailure,SetWorkspaceCheckReadyandSetSetupFailedin the metadata server, if nothing else needs them.
To decide
- Timeouts. ax-server's HTTP client for these calls times out after 2 seconds (
newProbeHTTPClientininternal/controller/task.go).ResumewaitsWorkspaceReadyTimeout, 15 seconds by default, and does not treat a runner that is still setting up as an error. Workspace setup can take minutes (git clones,setup.commands). A push that blocks needs a longer request timeout, andResumeneeds a rule for a push that outlives its wait. Check also whetheratenet-routerlimits how long a request may take. - Repeated pushes. ax-server retries a push until the runner answers, and pushes the task again on every resume. A push of work that is still in progress should wait for that work's result, not answer
200at once. - The runner contract.
docs/runner.mddocuments the202reply and the/readyz?check=workspacepolling for custom runners, so it changes with this. assignmentCh. The metadata server also holds a guest gRPC call for up to 10 seconds until a task is assigned. Check whether that is still needed once a resume returns only after the push is complete.
Related: #688 (the push protocol), #739 (its other follow-ups).
Metadata
Metadata
Assignees
Labels
No labels
Activity
ghchinoy commentedon Nov 25, 2026
I checked
go.ate.dev/[email protected]regarding theatenet-routertimeout question under To decide:cmd/atenet/internal/router/xds.gosetsdefaultRouteTimeout = 5 * time.Minute(configurable via--route-timeout, left at the5mdefault inmanifests/ate-install/atenet-router.yaml).envoyDefaultStreamIdleTimeoutis also5m, androuteIdleTimeout()automatically keeps it atmax(5m, routeTimeout + 30s)so Envoy will not reset a quiet synchronousPOSTbefore--route-timeoutfires.drainRouteBudget = 10s,internal/metadata/server.go:356,385): As noted inmanifests/ate-install/atenet-router.yaml:248-253, graceful shutdown drain deliberately does not scale with--route-timeout. If a router pod rolls out mid-git cloneorsetup.commands, the clientPOSTfails after ~10s while the runner is still executing setup inside the sandbox. TodayhandleSetupPush/handleTaskPushreturn200 OKimmediately on asameObjectretry, which only works becauseax-serverpolls/readyz?check=workspacenext; once200 OKmeans setup is complete, asameObjectretry needs to wait on the in-flight setup's completion result rather than returning200 OKearly (or409).