Repository navigation
Conversation
|
@aram356 this PR covers the A3 part of #1575: after-response work on Axum is drained on SIGTERM, and Fastly keeps its post-send path. I've asked on #1575 to narrow its checklist:
After that, this PR can close #1575. The EdgeZero pin is now R2 ( |
Brings #1635, which now carries the identity integration chain (dhruv8sh's spine with the core identity app, the protected native Geo from #1532, the identity conformance suite from #1613, the certificate-check statement from #1616, the health and startup-failure contract from #1617 applied to the native production runner, and the creative-proxy identity disclosure policy from #1615), into the after-response task drain on SIGTERM. Docs: the production startup guide keeps the base's boundary, where a store the selected provider cannot prepare stops the process before it listens and a missing or invalid config value or secret leaves only the probes answering, and adds the PR's shared shutdown grace for in-flight requests and registered after-response tasks, its whole-task identity budget and its A2/A8 activation note. Tests: the PR's Axum after-response fixtures build GeoInfo with the base's optional city, continent, coordinates and metro code. The values are unchanged. Code merges without conflict: the PR's Axum fallback scheduling, its shared core runner and its Fastly post-delivery changes compile on the base's identity app, conformance hook and failure router. Cargo.lock is the base's plus the PR's trusted-server-identity-providers dev-dependency edge for the Axum crate.
Brings in, through #1636 (cf1102c): - dhruv8sh's spine on #1489: #1639 (738ba34), #1640 (46530d8), #1612 (36e35f8), #1628 (384a481) and #1623 (6fd236e). - #1531 (47411de) and #1532 (4d17086, which renames the native Geo profile variable to TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE). - #1613 (2415b7d), then #1616 (c142e87), #1617 (b91770e) and #1615 (255c390), restacked on #1613. - #1635 (06b4044), restacked on #1615, and #1636 (cf1102c). Each conflict was resolved in the PR that sits higher. This merge is clean.
|
For the identity integration branch (#1608), I pushed |
Adopt #1646's shared after-response runner and drop this PR's duplicate: core ec::after_response's AfterResponseLookups and run, and Axum's schedule_lookups and prepare_after_response_lookups. schedule_after_response now checks the follow-up permit before registering and returns whether it registered, so a skipped navigation never holds the shutdown drain. Port the SIGTERM drain and registration tests to that runner, deriving the re-executed child test name from the module path.
|
For the identity integration branch (#1608), I pushed #1660 now sits above this PR and sends its follow-up write through |
|
For the identity integration branch (#1608), I pushed |
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
This PR changes IdentityApp::schedule_after_response in three ways. It checks for a follow-up permit before registering work, it returns whether a task was registered, and that return value is now #[must_use]. It also adds a has_after_response_permit check that doesn't use up the permit, and it removes the unused _settings parameter from Fastly's run_after_response_lookups. Finally, it adds subprocess SIGTERM drain tests for Axum, plus some documentation. Nothing here blocks merging. The one concern is that the new subprocess tests might be flaky.
Non-blocking
🤔 thinking
- Subprocess drain tests rely on tight wall-clock margins — see inline at
crates/trusted-server-adapter-axum/src/after_response_drain_tests.rs:691
Cross-cutting / body-level findings
- 👍 The permit check matches the shared runner and fixes a drain stall — The new permit check does the same thing as the shared runner in
lookups.rs:307, which skips work when there is no permit. So the only change in behaviour is that skipped navigations no longer register a task that would do nothing. Those empty tasks can no longer hold up the shutdown drain, which is correct. The call sites in the Axum and Fastly adapters are updated consistently.
CI Status
- release scripts: PASS
- integration tests: PASS
- CLAUDE.md symlink guard: PASS
- format-docs: PASS
- integration tests (Fastly EC lifecycle): PASS
- health-startup (cloudflare): PASS
- health-startup (spin): PASS
- browser integration tests: PASS
- health-startup (axum): PASS
- format-typescript: PASS
- worker-deadlines (spin): PASS
- Native provider acceptance script: PASS
- trace runtime and browser acceptance: PASS
- vitest: PASS
- worker-deadlines (cloudflare): PASS
- cargo test (axum native): PASS
- cargo test (cross-adapter parity): PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- docs-proposal scripts: PASS
- record-provider-image: PASS
- cargo test: PASS
- cargo fmt: PASS
- HTML EOF runtime (Fastly): PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- CI Node pin guard: PASS
- ts dev lint domains (changed lines): PASS
- Fastly response diff script: PASS
- stock-celld-records: PASS
- health-startup (fastly): PASS
- prepare integration artifacts: PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- local-provider-image: PASS
| app.wait_marker("registered"); | ||
| let start = app.terminate(); | ||
| thread::sleep(Duration::from_millis(450)); | ||
| app.release(); |
There was a problem hiding this comment.
🤔 thinking — Subprocess drain tests rely on tight wall-clock margins
This test, like the other subprocess tests, depends on tight wall-clock timing. The grace period is 1 s, the parent sleeps 450 ms, the task delay is 850 ms, and exited allows only 300 ms of slack. On a loaded CI runner, a slow child start or slow scheduling could change which happens first: the grace period running out or the task finishing.
Running::start also has a small race. It reserves a port, drops the listener, and only after that does the child bind to the port.
Consider widening the margins. Or gate each stage with marker files, as hold-write does, instead of relying on the delays alone. Either way, whether the test passes would no longer depend on how fast the runner is.
There was a problem hiding this comment.
In d5a5ae1: Replaced eventual-write timing races with held-body/held-write stages, named durations, a 4s shared grace and an observation bound anchored to the original signal. The actual shared-deadline control rejects a fresh second grace. The child still reserves and releases a port before binding, so that handoff race remains; I am leaving this thread open for that part.
Validation: required local gates, targeted real-process controls, all three deadline runtimes and all four normal-application startup smokes passed. Hosted verification is now confirmed for this exact revision: all 34 current checks are SUCCESS.
|
For the identity integration branch (#1608), I pushed Takes #1646's new head 6b4a5fd, which carries #1506's repin of EdgeZero to rc/identity at 1619078a (8edc50e), a revert that removes IABTechLab/edgezero#522 (portable Fastly record providers) and IABTechLab/edgezero#524 (outbound mTLS client identities). The merge is clean. |
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed against #1646 at 6b4a5fdc0. The permit gate preserves the shared runner and I found no production regression in this diff. I ran cargo test-axum --offline --locked --lib after_response_drain_tests on the exact PR head: 10 passed, with the subprocess entry point intentionally ignored by the parent test run. The inline comments cover places where the tests can pass without proving the stated contract, stale design docs, and optional cleanup. The fixture proves a guarded write can complete on SIGTERM; the production binary and record-provider check remains separate in #1654.
| /// | ||
| /// Returns whether a task was registered. A missing scheduler or a rejected | ||
| /// registration is logged and drops the work without running it. | ||
| #[must_use = "returns whether follow-up work was registered; failures are already logged"] |
There was a problem hiding this comment.
R7. Optional: keep the registration outcome internal
Both production callers discard the new #[must_use] result; only the tests observe it. The flag is useful for synchronous test assertions. If you prefer to keep the existing API, the tests can instead assert scheduler calls and task effects, and this method can still log registration failures and return ().
There was a problem hiding this comment.
In d5a5ae1: Retained the existing synchronous registration result: it lets callers/tests distinguish accepted registration from an early guard or scheduler rejection. Production callers still explicitly discard it, and the documentation distinguishes registration from execution/persistence. No additional API change is included for this optional suggestion; leaving the thread open.
Validation: required local gates, targeted real-process controls, all three deadline runtimes and all four normal-application startup smokes passed. Hosted verification is now confirmed for this exact revision: all 34 current checks are SUCCESS.
| trusted_server_identity_providers::partner_registry(&settings.ec) | ||
| .expect("should build partners"), | ||
| ); | ||
| let coordinator = Arc::new( |
There was a problem hiding this comment.
R8. Optional: share the eligible identity setup
The runtime fixture and registration_case build the same partner, coordinator, consented row, and finalize inputs. A shared setup helper would keep their eligibility assumptions in sync. Keep each scenario's client, timing, and choice to finalize visible at the call site.
There was a problem hiding this comment.
In d5a5ae1: Deferred the optional broader fixture-setup consolidation. The runtime and registration fixtures intentionally keep their distinct real SDK/in-memory client ownership and finalization visible. Shared helpers added here cover the actual streamed-response and header observations. I am leaving this optional cleanup thread open.
Validation: required local gates, targeted real-process controls, all three deadline runtimes and all four normal-application startup smokes passed. Hosted verification is now confirmed for this exact revision: all 34 current checks are SUCCESS.
PR #1646's new head brings its identity consent and delivery boundary enforcement, plus the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536, #1535, #1537 and #1538. crates/trusted-server-core/src/ec/app/route.rs: #1646 moved the EC route's after-response scheduling into a finalized callback so Fastly can hand the work off after delivery, and #1636 made schedule_after_response return whether the work registered. The resolution keeps #1646's callback, and the native ec_route callback keeps #1636's handling of the must_use result.
PR #1646's new head brings wave B: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806, carried up through the chain. The merge is clean. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
|
Round 12 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
PR #1646's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
PR #1646's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage and #1535's Sourcepoint consent mirror deduplication and consent update coverage. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
PR #1675's new head brings #1675's switches that turn off POST /auction while the auction is disabled and the first-party creative endpoints while creative rewriting is off, together with the identity chain between #1646 and #1675 that #1667 did not carry yet: #1636's Axum after-response drain on SIGTERM, #1626's provider opt-outs and legacy EID expiry on Fastly and Axum, #1656's configurable Edge Cookie browser gate, #1661's refusal of EC creation when a trusted JA4 contradicts the User-Agent, and #1662's Fastly EC route acceptance and capped mirrored expiry. docs/guide/configuration.md: #1675 reworded the enabled row of the [auction] table to say that it also turns on POST /auction, and #1667 added the mtls_slot row, which widened the table. The resolution keeps #1675's enabled text and #1667's mtls_slot row, with the table reformatted by Prettier. Semantic break in crates/trusted-server-core/src/integrations/prebid.rs: #1675's owner commit d141923 added a test plan with no browser routes, whose ProviderConfig and AuctionPlanConfig literals predate #1667's 0985d67, which added the mtls provider field, and eaa2b3e, which added the mtls_slot plan field. The merge applies cleanly but the core tests no longer compile. The fix belongs in this link because it is where the two changes first meet. The literal gains mtls: false and mtls_slot: Default::default(), as #1667 wrote in the neighboring prebid.rs literals. Cargo.lock is unchanged.
|
Round 15 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
|
Cascade of #1533's Axum startup-test port fix ( |
…tegration chain
|
Merged #1627's runtime KV removal ( At the maintainer's request, that commit removes the generic runtime KV store Only that commit was merged, not the base branch's new head. Conflicts were resolved in Checks on this head: no reference to the removed store remains and |
PR #1503 at 6a8797e: Add ts ec show and ts ec eids admin diagnostic commands PR #1557 at a435778: Carry Sourcepoint TCF consent to Trusted Server PR #1607 at 07086f2: Send the resolved client IP to the publisher origin PR #1627 at 5b7fc3d: Wire declared stores and document unsupported Axum KV PR #1636 at d838931: Drain Axum after-response identity tasks on SIGTERM PR #1653 at 5b86d9b: Clarify and verify the Axum local config handoff PR #1654 at be495b3: Verify pending record writes drain within shutdown grace PR #1655 at 888c5f1: Configure EC lifetime and renew it on eligible visits (DEC-13) PR #1659 at 7b1d4a7: Verify geo consent paths on Axum and Fastly PR #1660 at 64a1baa: Retry an after-response write that loses its CAS PR #1667 at 1359722: Present a client certificate on auction providers that set mtls PR #1709 at bc43a3e: Keep the EC out of bid request IDs and gate user.id on EID consent PR #1710 at dc728a1: Apply pull-sync consent checks to identify PR #1713 at ffa7597: Apply consent rules to first-party click redirects PR #1722 at 070e2b0: Use applicable GPP sections from the CMP instead of header sections PR #1666 at 4720b0b (Verify identity gates and provider deadlines on Axum) arrives through #1659, and PR #1622 at c878e6e (Report CMP consent to the EC route and merge its answer into Prebid) arrives through #1722. Every other chain PR arrives through the tips above. The tree is the conflict-free union of these tips and carries no resolution of its own.
|
Round 17 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1646's new head ( Checks on this head: no conflict markers; |
Summary
Exercise Axum's registered identity work through EdgeZero's response-body release and SIGTERM drain. Reuse #1646's shared
IdentityApp::schedule_after_response/run_after_response_lookupsrunner and production record/permit path.Revision status, checked 2026-12-03 12:13 UTC: the maintainer advanced this PR to
ee1bf9e028, with basefeat/1574-axum-shared-identityatb06dcbd0ee0ba9bc8e48523b4084076c50d4796cand EdgeZeroef5cbf308. Earlier signed review correctiond5a5ae17bfremains in its history. Local/runtime and hosted results below are historical for their named revisions; they do not qualify this later SDK merge. Exact-head CI reports 30 contexts (30 QUEUED); full current-head qualification is assessed separately.Registration requires both work and the original finalized follow-up permit. The scheduler's boolean result describes registration only; it does not promise execution or persistence. Production callers explicitly discard it, and registration failures remain logged. Fastly retains its post-send decision and shared runner; its wrapper loses an unused settings argument.
Part of #1575. This PR targets
feat/1574-axum-shared-identity(#1646). The original review fixes were qualified with base0070304f9a8cfe76d08b07c194d267dae78d0498and EdgeZero8a73c0978806bdb60caccb17a6ddf34e14f3bd5e; those inputs are historical. The later maintainer source/base and SDK update are recorded above. The review fixes themselves introduced no dependency or scheduler implementation changes.Review corrections
100mscancellation diagnostic and a successful health request before the first SIGTERM. A wrong500msconfiguration must fail independently of shutdown.reason=grace_exhausted, rejectforced_stop, and anchor the observation bound to the original signal. NamedDurationfields keep task budget, write delay and configured grace explicit.The fixture still reserves and releases a port before the child binds. Startup is bounded with captured diagnostics; this PR does not eliminate that port handoff race. The optional broad fixture-setup consolidation is deferred, and the existing synchronous registration result is retained.
Scope and requirements
The fixture uses a controlled in-memory record store and scripted pull-sync response, plus a real SDK outbound probe. It qualifies actual SDK task registration/body release/shared drain with a guarded fixture update. Actual application-binary/provider shutdown qualification remains #1579 / #1654. No deployed environment, live vendor or universal all-adapter shutdown qualification is claimed.
Fastly's behavior remains unchanged. Cloudflare
waitUntiland Spin's before-response path remain separate work. Application configuration or secret failure follows the existing health contract:/healthremains available while readiness and ordinary application routes report unavailable; provider preparation can fail before listening.Validation
Review-fix commit: d5a5ae1.
Targeted real-process suite against the restored pinned SDK: 11 passed, one subprocess entry ignored by the parent runner. Discriminating controls reject premature SDK release at handler return, a fresh second task grace, actual second-SIGTERM forced stop, a wrong 500ms budget and removal of only the work guard. Normal SDK behavior passes before and after the isolated SDK controls; all temporary overrides and the exact lockfile are restored.
Full required local gates passed on the qualified tree: all target-matched Rust tests/lints, CLI/parity/build-digest and AWS example checks, JS build and suite (83 files / 3,373 tests / no type errors), formatting/lint/docs, environment guard (including 58 Linux ARM compiler fixtures), native AWS entrypoint contract, all three deadline runtimes, Fastly identity/proxy controls, both native Geo suites, API docs/doctests, and staged/full-PR domain checks. Fresh normal application artifacts passed health/startup smokes on Fastly, Axum, Cloudflare and Spin. Rust 1.98.1, Node 24.20.0 and repository-pinned Viceroy 0.22.0 were used.
An initial unchanged native acceptance harness hit a startup address-in-use collision; the subsequent full command passed with that harness unchanged. No timeout or assertion was relaxed; the port-handoff limitation above remains.
All 34 hosted checks for review-fix commit
d5a5ae17bf80762937bed5481992ab4fd45ab2c8were SUCCESS. That qualification is historical and does not establish current-head verification after the SDK merge. The port-handoff limitation and the two optional API/setup discussions remain open.Spec
Design · Plan.