test(gateway): reproduce whole-response buffering - #443
seonghobae wants to merge 17 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Fresh exact-head execution update (2026-09-24 KST): Semantic REDs:
This is source-causal semantic RED, not bootstrap/format/runner noise. Current SAST |
|
@devin Current serialization is clear: #441 has been normally merged into canonical parent #435, and #443c47b35c is now the sole child writer for issue #442. Please implement the minimum causal GREEN directly on the existing Verified RED/source cause: current Minimum repair only:
Run |
|
Failed to start a Devin session. Please try again. |
|
@devin Retry the failed session start from issuecomment-5814995333 on the unchanged exact head |
|
Failed to start a Devin session. Please try again. |
Refs #442.
Scope and current serialization state
This Draft is the Wardnet-owned generic gateway response-streaming/backpressure lane. The branch has now non-force adopted the complete current Coraza + HTTP mediation parent instead of racing the same gateway seam.
Current topology:
main@f8260f1e03836039ff9463dd99fa982e4e270c4bthrough parent fix(security): harden live Coraza authority boundary #435;534a48b54dcd9e668ceeec8d3d00f824531b0ad1, after fix(gateway): enforce bounded HTTP header mediation #441 was normally merged into it;c47b35c36eed9aad1c0968c82aa14b1c40cf352b;2cccfb37b85c3fc30d4b91d3027266feaf338774with current parent534a48b54dcd9e668ceeec8d3d00f824531b0ad1;tests/gateway_streaming.rs,tests/gateway_a_streaming_backpressure.rs,tests/gateway_streaming_bounded_memory.rs, andtests/gateway_streaming_cancellation.rs;The seven hostile buyer contracts remain:
Content-Lengthmust not cause the admitted prefix to wait for whole-body materialization;1 MiB + 64 KiBprefix without declared length must cross before the held tail, with the producer itself emitting bounded 16 KiB chunks;All timing fixtures wait until the real loopback upstream has accepted the request before starting the semantic timing witness. Cleanup releases are used only on current-behavior failure paths so a RED cannot strand its fixture.
Executed RED lineage
Predecessor
eedc56c1e0fefc4654f2e1bdc8b7ceae99a28825acquired hosted Ubuntu 24.04 in CI35610237483, rust job106367237430. Checkout, toolchain, formatting and all existing 142 library unit tests passed before the real gateway integration binary failed the three intended cases: delayed-tail response observability, dishonest-large-Content-Lengthprefix observability, and partial-upstream-failure prefix observability. SAST35610237552and Security35610237788were terminal SUCCESS. The required CodeQL failure was handed to the canonical central settlement owner; it is not promoted as Wardnet GREEN.Predecessor
239c747848a8241cbbccd66e6f91d20725860c51added only the slow-consumer/concurrency fixture and first exposed rustfmt-only noise. Exact successor2cccfb37b85c3fc30d4b91d3027266feaf338774applied only that formatter output. CI35921459298, rust job107386159436, then passed checkout/toolchain/formatting, all 142 existing library unit tests and the pre-existing integration suites before failing only the two newly added buyer cases:unpolled_buyer_body_does_not_drain_the_entire_large_upstream: Wardnet/upstream read-ahead drained all1024 x 64 KiBchunks (64 MiB) while the buyer body was intentionally unpolled for 250 ms, far beyond the explicit 8 MiB witness;concurrent_held_streams_expose_prefixes_and_do_not_block_fast_buyer_traffic: four admitted held upstreams kept buyer response heads/prefixes behind unreleased tails.Those receipts establish the causal whole-response-buffering finding. They are historical after the ancestry movement and do not transfer as exact-current GREEN.
Valid finding and minimum causal repair boundary
Fresh source review on the adopted parent confirms the generic proxy still calls
response.bytes().awaitbefore constructing the downstream response. That materializes the complete upstream body, causally explaining every executed RED above.The minimum Wardnet-owned repair is therefore one bounded asynchronous body relay at the existing generic proxy boundary: preserve the already-admitted status/header map, expose the upstream body as a streaming Axum body, retain natural downstream backpressure/cancellation, and leave a late upstream body error observable through the downstream body. It must not add an unbounded channel, eagerly drain the stream, automatically replay a request, infer success after a partial failure, or absorb EgressWeave transport policy. The existing truncated-body unit fixture must likewise assert successful response-head admission followed by a body-read error instead of requiring pre-response
BAD_GATEWAYwhole-body materialization.Serialization is now clear because the complete #441 mediation delta is already in current parent #435. A production repair may proceed only on this restacked child (or a verified bounded successor) and must compose once with the inherited header/representation mediation authority.
Exact-current evidence
Current exact
c47b35c36eed9aad1c0968c82aa14b1c40cf352bis mechanically mergeable against exact parent #435 and still changes only the four hostile test files. Current CI35985182231is now terminal semantic RED on the expected streaming defect: formatting and all inherited/pre-existing test coverage run before the hostile streaming/backpressure assertions fail because current production still whole-body materializes upstream responses. Current SAST35985182196and Fuzz35985182228are terminal SUCCESS; Security35985182193and CodeQL PR35985182368remain queued. No predecessor result is promoted over those current receipts.The minimum causal production repair has been dispatched on this existing branch at the unchanged exact head with instructions to replace only whole-body collection with a direct bounded asynchronous Axum relay, preserve admitted status/headers and downstream body errors, update the legacy truncated-body acceptance, and run fmt/locked workspace tests/strict Clippy. No competing PR, force update, transport-policy duplication or gate weakening is authorized.
Keep Draft until the causal streaming repair is present and one unchanged exact candidate passes format, locked workspace tests, strict Clippy, Fuzz, security/SAST/CodeQL, 100% owned production statement/branch/edge/public-rustdoc evidence, realistic async buyer-path/k6 acceptance including p95 <= 20 ms for Wardnet-owned processing, reviews/threads, fresh parent compatibility, and all live package/SBOM/provenance/governance gates.
No force push, destructive rebase, self/model approval, synthetic status, no-op redispatch churn, gate weakening, routine bypass, mutable foreign dependency, source copy, cross-service SQL, or predecessor-evidence transfer.