Repository navigation
Dispatch is acknowledged or declined by the worker - #2808
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
amankrx
force-pushed
the
pr/dispatch-ack
branch
from
September 28, 2026 22:50
5bb2daa to
550dc54
Compare
amankrx
force-pushed
the
pr/dispatch-ack
branch
from
September 28, 2026 22:54
550dc54 to
2db5ce9
Compare
(cherry picked from commit a52c0a19ad03c7cab606fdb1c087ca3b76d45213)
…ate decline does not pause, counters count requeues, a dead channel is a decline
…, and a late acknowledgement is answered with a kill
amankrx
force-pushed
the
pr/dispatch-ack
branch
from
September 28, 2026 23:08
2db5ce9 to
736afcf
Compare
corcillo
reviewed
Sep 29, 2026
corcillo
reviewed
Sep 29, 2026
corcillo
reviewed
Sep 29, 2026
corcillo
reviewed
Sep 29, 2026
…ls on a full channel
corcillo
approved these changes
Sep 29, 2026
This branch was successfully deployed
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.
What and why
A dispatch was fire-and-forget: the scheduler charged the worker's budget and moved on, and a worker that was full, short of memory or shutting down ran the action anyway or dropped it. The worker now answers each dispatch with
ExecuteAcceptedorExecuteDeclined(at capacity, load, shutting down). A declined action goes back to the queue untried, without counting an attempt, and the worker is paused until a keepalive; the decline itself only refreshes liveness and does not lift the pause. Withdispatch_ack_timeout_sset, a dispatch never acknowledged within that many seconds of the send is requeued the same way, and a worker that acknowledges after that is told to stop it.ConnectionResulttells the worker the scheduler speaks this and which platform property the memory veto reads, so a decline for load and the scheduler's veto look at the same number.How was this verified?
dispatch_ack_test.rscovers decline with the pause and requeue, the channel-full path, the unacknowledged sweep on and off, and a late decline for an operation the worker no longer holds leaving it unpaused. Service tests show an acknowledgement arriving at the timeout is recorded before the liveness refresh that runs the sweep, the timeout counts from the scheduler clock at the send, a late acknowledgement is answered with a kill, a decline keeps the worker paused until a keepalive with room, and a kill that does not fit the worker's channel is deferred to the next sweep instead of evicting the worker. Worker tests show a worker atmax_inflight_tasksdeclining the second dispatch, and a single-use worker declining for load and still taking the next dispatch. Each fails without its fix. On a test cluster a worker holding a 40 GiB resident process declined a 16 GiB action withLoad, and the action ran elsewhere without a failed attempt.Risk
Three new proto messages and two optional fields on
ConnectionResult; an older worker never sends them and an older scheduler never sets them, so mixed versions fall back to today's behaviour.dispatch_ack_timeout_sis off by default. The worker's channel to the scheduler is bounded now, so a worker that stops reading is reported as channel-full instead of growing without bound.AI assistance
An agent drafted the change and I reviewed every line.
This change is