Skip to content

Axum: preserve incremental streaming with bounded backpressure #394

Open

Description

@ChristianPavilonis

Description

Main collects Body::Stream into an unbounded Vec before returning an Axum response; crates/edgezero-adapter-axum/src/response.rs:19. Proxy uploads/downloads also collect entire bodies. PR #275 already replaces these seams with owned HTTP/1 egress and portable streamed outbound contracts. This issue tracks residual production streaming acceptance after integration.

Steps to reproduce

Use delayed multi-chunk and open-ended responses, a slow/zero-read client, large uploads/downloads, a disconnect, a failing producer and shutdown. Inspect first-byte timing, retained bytes/chunks and exactly-once cleanup on the actual native transport.

Expected behavior

Clients receive chunks before producer EOF; producer progress and retained body data follow documented transport bounds. Disconnect/error/deadline/shutdown paths release owned work without hangs.

Impact

Whole-body collection delays first byte, makes open-ended responses unusable and scales retained memory with transfer size. Finite in-memory fixtures do not prove backpressure.

Proposed fix

Adopt accepted #275 streaming, connection and response-egress contracts; reuse its delayed/error/disconnect tests and add only missing production cases. Coordinate #392 draining and #395 proxy acceptance. Preserve non-Send core bodies and BestEffort completion/backpressure/abort/write-deadline classifications; server terminal reports do not prove end-client receipt. Do not add a second channel bridge or arbitrary stream-lifetime limits.

Done when

  • Re-audit the accepted PR feat: implement portable outbound HTTP and request lifecycle contracts #275 implementation and record which checks are already covered. Add only residual changes and missing production acceptance evidence.
  • A delayed multi-chunk response reaches the client before the producer emits its final chunk.
  • An SSE-style or open-ended stream remains usable without waiting for end-of-stream.
  • A slow consumer keeps producer progress/retained body data within the documented transport bound. Record native runtime evidence without asserting end-client receipt.
  • Large uploads and proxied downloads have bounded retained body data and preserve bytes/status/headers.
  • Consumer disconnect, source error, deadline, and shutdown clean up producer work without hangs.
  • Tests use delayed and failing streams, not just ready-in-memory fixtures.
  • Existing WASM target checks and portable core tests still pass.

Related

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions