Repository navigation
Conversation
This branch has not been 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.
Summary
StreamProcessor::async_finish. Chunk processing stays synchronous; each stage finishes before downstream EOF, and accepted output passes through downstream ordinary processing.publisher.allow_async_html_finish = true(default false). Only declaring factories retain output; core owns bounded fallback/candidate buffers, applies one shared deadline, and preserves fallback on optional failure.This capability belongs to Trusted Server's processor lifecycle and request services. No EdgeZero repin, signing service, publisher workflow, queue or background job is introduced. Signing is an example consumer, not the API requirement.
Latency: absent capability adds no EOF I/O, and permission alone creates no callback. Non-retaining Fastly processing can release ready bytes before EOF work; the fresh fixture delivered its first body byte at 5.8 ms while its lookup took 150 ms. Full-page retention delays initial delivery. Axum, Workers and Spin currently buffer publisher responses, so enabled EOF work can add TTFB. An auction body-close/tail waits for the chain before assembly; early delivery does not guarantee early page completion.
Memory and deadlines: limits apply per holder/candidate, not total request memory. Codec state, adapter buffers and held output can coexist; integration-owned allocations are outside the bound. The suffix uses capped geometric capacity growth. Errors, poisoned candidates, invalid markers, expiry and late results retain the current fallback allocation; earlier accepted output remains accepted. Retention overflow releases bytes once and skips optional work; outer response limits still apply. The initial 5000 ms EOF budget follows the issue example; the 60000 ms maximum is a configuration ceiling. Workers/Spin/Axum timers interrupt yielding work; Fastly consumers must independently bound blocking host calls.
Cache scope: registered async capability bypasses processed-template reads/reservations/stores before lookup and eligible processed HTML uses
private, no-store, including fallback. Raw-origin readthrough remains independent. Shared-template cold-miss storage described in #1241 is deliberately deferred until output identity, freshness, invalidation and hit-execution rules are agreed. This remains a draft; maintainers must accept the initial scope or require the deferred cache work before full issue resolution. Partial/range/bodiless/unsupported response bypasses and independent cookie/diagnostic privacy remain documented and tested. Consumers retain responsibility for structural placement; marker counts are an assembly guard, not an HTML parser.Changes
streaming_processor.rs,streaming_processor/finish.rshtml_processor.rs,html_processor/finish.rs.github/workflows/test.ymlAGENTS.md, scripts README and testing/integration/config guidesThe runtime verification tooling is native Rust in the existing integration-test crate. This PR adds no Python files and its EOF CI jobs need no Python setup. The feature gate keeps external runtime checks out of the ordinary integration-test selection; the added dependencies are test-only existing workspace dependencies.
Closes
Part of #1241. The EOF lifecycle is implemented; processed-template caching for async output remains deferred as described above. This draft does not claim full resolution of that cache acceptance criterion.
Related: #1226 contains the identical auction
web_time::Instantcorrection. This PR retains that traced #1240 fix; broader clock work remains separate. KV adapter wiring under #1139 is separate.API migration
Existing
StreamProcessorimplementations inherit default methods. HTML factories opting in must declare matching capability and receive operator permission. Callers constructingAuctionDispatchdirectly must provide its new requiredintegration_registryfield, using the same registry for request dispatch and response processing. Rust callers constructingPublisherwith a struct literal must supplyallow_async_html_finish(normallyfalse) or usePublisher::default()with struct update syntax.Test plan
These are fresh local results after the latest review fixes; hosted CI results remain separate.
git diff --check, workflowactionlint, native Rust harness Clippy and Bash syntax.fastly compute serve: actual Fastly verification uses Viceroy directly.An extra unoptimized Fastly run did not become ready within the existing startup window; the documented release command passed. The first concurrent JavaScript run hit one 15-second Prebid test timeout; the focused pair and full 1211-test rerun with two workers passed. Vitest's configured type assertions pass. An extra package-wide
tsc --noEmitremains outside the gate and reports the pre-existing errors explicitly documented invitest.config.ts; this change modifies no JavaScript sources.Independent source and spec/plan reviews found no remaining blockers. See the current specification, implementation plan and runtime checks.
Checklist
logand controlled categories.unwrap()or dependencies.