FM-036 Additional Request Handling and HTTP Behavior

Request Size and Resource Exhaustion Failures

Large payloads, deeply nested objects, or oversized headers cause memory pressure, slow processing, or instability instead of a documented rejection.

Failure explanation

The API does not enforce sensible resource limits or handles boundary sizes poorly. Oversized bodies, deeply nested JSON, huge arrays, long strings, or large headers can consume excessive memory and CPU, cause timeouts, or crash parsers. Conversely, limits that differ between gateway and backend can reject requests unexpectedly. The goal is controlled boundary validation, not stress-testing production.

Example

The gateway permits a 10 MB JSON request, but the backend parser has a 2 MB limit and returns an unhandled 500. Another route accepts a deeply nested JSON object that causes excessive recursion and worker exhaustion.

How to test

  • Test just below, at, and above documented size and depth limits.
  • Cover large arrays, strings, multipart uploads, and header sizes.
  • Verify consistent gateway/backend limits and documented 413 or validation responses.
  • Use isolated environments and bounded test payloads; monitor resource consumption.

Expected behavior

Requests within documented limits are handled reliably. Requests exceeding limits are rejected predictably without crashing or exhausting shared resources.

Runnable examples

Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.