Bound streamed exec-server HTTP response bodies (#32112)

## Why

Frame-count backpressure does not bound the amount of executor-controlled data
retained in streamed HTTP response queues, and a single body delta could exceed
the intended wire size.

## What changed

- Limit each decoded `http/request/bodyDelta` payload to 1 MiB, split locally
  produced response chunks at that boundary, and reject oversized incoming
  deltas.
- Apply a shared 16 MiB byte budget across queued HTTP response streams. Release
  capacity as deltas are consumed and fail a stream when the budget is
  exhausted.

## Testing

Added coverage for rejecting an oversized delta and for failing a stream after
its queued deltas exhaust the shared byte budget.

GitOrigin-RevId: be9205fef44b0ec96b84b31a8e059b1cb9cd3f3b
This commit is contained in:
jif
2026-07-10 09:51:08 +00:00
committed by copyberry
parent 6ad0e943cc
commit 4ba2815014
5 changed files with 315 additions and 30 deletions

View File

@@ -40,6 +40,8 @@ pub const FS_COPY_METHOD: &str = "fs/copy";
pub const HTTP_REQUEST_METHOD: &str = "http/request";
/// JSON-RPC notification method for streamed executor HTTP response bodies.
pub const HTTP_REQUEST_BODY_DELTA_METHOD: &str = "http/request/bodyDelta";
/// Maximum decoded response-body bytes carried by one streamed HTTP notification.
pub const MAX_HTTP_BODY_DELTA_BYTES: usize = 1024 * 1024;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]