Repository navigation
Matching pass: room that opens mid-pass goes to the oldest waiting action, one store read per queued action - #2806
Merged
Conversation
(cherry picked from commit cb4642683c8821b4582e4792fc13b337fa1d1346)
(cherry picked from commit f9ca73fa1be6d3ce6a00326f2b71b056a5c9e520)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
amankrx
force-pushed
the
pr/matching-pass
branch
from
September 28, 2026 21:33
881e737 to
4c0c177
Compare
… report is room opening, the parked metric counts confirmed sends
amankrx
force-pushed
the
pr/matching-pass
branch
from
September 28, 2026 21:34
4c0c177 to
9c6f73f
Compare
MarcusSorealheis
approved these changes
Sep 28, 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 pass reads the queue one action at a time, about a millisecond each on a store-backed queue. When a worker freed up mid-pass, its room went to whatever action the pass was reading, newer than everything it had already passed over. Actions that find no room are now parked in listing order, highest priority first then oldest, and when the fleet's capacity changes the pass offers the room to them in that order before the one in hand, asking the fleet once per property shape. A keepalive reporting more free memory counts as room opening too.
scheduler.matching.parked_dispatchedcounts the parked actions a worker was actually told to run.The listing also serves each action from the record it already read instead of fetching it again, one store read per queued action instead of two.
How was this verified?
Gated-queue tests free a worker mid-pass and check the oldest waiting action gets the slot, check two slots go to the two oldest across interleaved shapes rather than draining one shape, and check a higher memory report mid-pass goes to the older vetoed action; each fails without its fix. Store tests cover the listing serving the loaded record and keepalives still merging into it. On a test cluster, a 1,000-action burst went from 669 dispatched out of order to 0, and the pass from 40 ms to 17 ms.
Risk
Medium: the matching pass is rewritten, though its outcome per action is the same. Parking is capped at 10,000 actions per pass. No config, wire or data changes.
AI assistance
An agent drafted the change and I reviewed every line.
This change is