Skip to content

[bug] Bound runtime HTTP response buffering #354

@sizumita

Description

@sizumita

Affected component

imagod

Summary

The HTTP runtime path still uses a whole-body response contract. The runner collects the entire outgoing response body into memory and returns it as a single RuntimeHttpResponse.body, but there is no explicit maximum response size.

Steps to reproduce

  1. Run an HTTP component that emits a very large response body.
  2. Send a request through the runner ingress.
  3. Observe runner memory growth while the response is accumulated.

Expected behavior

The runner should either stream HTTP responses or enforce a clear fail-closed response size limit.

Actual behavior

runtime_response_from_hyper collects the full body into a Bytes accumulator and returns it through a whole-body runtime contract, without an obvious response size limit.

Version

3f1c39e

Environment

other

Resource impact (optional)

response memory scales with body size because the runtime contract is whole-body and has no explicit response cap.

Additional context

Evidence:

  • crates/imagod-runtime-wasmtime/src/http_supervisor.rs:175
  • crates/imagod-runtime-wasmtime/src/http_supervisor.rs:241
  • crates/imagod-runtime-internal/src/lib.rs:134

Suggested direction:

  • Add a max_http_response_body_bytes contract and fail closed when exceeded.
  • Longer term, move the runtime HTTP contract toward streaming or spool-to-disk behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions