Repository navigation
perf(artifact-delivery): build a Resolution in its own request - #508
Merged
Merged
Conversation
The queue delivered a build 1.2 s after the request at the median and 3.4 s at worst. Its consumer ran in US colos, 158 to 244 ms from the D1 primary in Sydney per call, and placement cannot move a queue consumer. The POST now runs the build after its response, in waitUntil, where the request reached Cloudflare. A delayed queue message goes out first, so the queue resumes a build the runtime stops. A build that throws goes to the queue at once, and one that follows an earlier build goes back after its wait, as in the consumer.
harlan-zw
added this pull request to stack #509
October 6, 2026 16:22
…1eb0: schedule buildAfterResponse work through runAfterResponse, since H3Event has no waitUntil on h3 1.15. Update the route tests to the delayed fallback send, the throw
Contributor
🤖 MERGED
GitHub merged this pull request.
408296b2-de99-462d-bda2-b77954738896 Selected findings run after merge and open separate pull requests. |
Contributor
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: READY.
harlan-zw
added a commit
that referenced
this pull request
Oct 7, 2026
#508 builds a Resolution in its own request. Keep its after-response build beside the linked-files header, and give its tests the linked_files column.
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.
Stacked on #497.
🔗 Linked issue
None. Launch prep for
skilld runlatency, approved by Harlan.❓ Type of change
📚 Description
A cold build waited for the queue, then ran far from its database. In 20 timed production runs on 2026-10-07, the queue delivered a build 1.2 s after the request at the median and 3.4 s at worst. Its consumer ran in US colos (SJC, LAX, DFW) and each D1 call to the Sydney primary took 158 to 244 ms. A fresh build makes 14 such calls since #496.
The POST now runs
processArtifactBuildinwaitUntil, with the same dependencies the consumer uses. The queue stays the fallback:SERVICE_UNAVAILABLE, as in perf(artifact-delivery): answer Resolution polls when the build moves #497.Builds in requests are not limited by the consumer's
max_concurrency. The read App's GitHub quota still bounds cold builds.A run that reaches Cloudflare far from Sydney still pays the D1 round trips. The Smart Placement header on
skilld.devresponses readslocal-SYDfrom Sydney today, so placement does not move requests toward the database. Removing that cost for every region needs a builder Worker placed near Sydney withplacement.region, a new deploy unit.