Repository navigation
Conversation
|
The current commit is not limited to #180: it also adds retry guidance for #141 and OpenAPI value-budget wording for #362, overlapping the focused PRs #449 and #448. Please split or coordinate these changes so each contract has one authoritative edit. Separately, the ~16 KiB statement is an observed edge/proxy limit rather than a server-enforced configuration value; keep it explicitly deployment-dependent and supported by reproducible evidence, not as a universal protocol ceiling. The only visible upstream check is skipped [code]smith. |
|
Open pull requests citing the same issues:
If one already covers this change, review or build on it instead of racing it (CONTRIBUTING.md "Overlapping work"). |
luch91
left a comment
There was a problem hiding this comment.
Reviewed exact head 12811f7. The manual now distinguishes the reliable below-budget GET lane from the probabilistic over-budget behavior and directs callers to POST; the added tests check the served manual and the related OpenAPI descriptions. No source-level blocker found in this scoped documentation change.
…p-labs#180) The GET write lanes carry their payload in the URL, so the binding limit is URL bytes, not the advertised `maxLength: 4096` character cap — 4096 CJK characters is a ~36 KiB URL. That budget was enforced only by uvicorn's h11 `--h11-max-incomplete-event-size`, which rejects an over-long request line only when it arrives across TCP segments, so the same over-budget URL 200s or 400s at random (flop-labs#180's measured ~20-67% coin flip above 16 KiB), and the 400 it produces is a bare origin `Invalid HTTP request received.` that names no length, no budget, and no escape. Make the budget the enforced contract: - app.py MAX_URL_BYTES (16 KiB): HeaderLimits now refuses an over-budget URL with a 414 in the app's own voice, naming the byte count and pointing at the POST body. Runs before routing, so the request never reaches a handler. - Dockerfile --h11-max-incomplete-event-size 16384 -> 32768, above the budget, so a just-over-budget request reaches the app for that clean 414 instead of dying opaquely in the parser. Trade-off documented at the CMD: worst-case per-connection incomplete-request-line buffer doubles to 32 KiB, bounded by --limit-concurrency to 4 MiB against a 128 MiB container. Tests: deterministic refusal at the boundary, the full-length CJK case (414 then POST carries it byte-exact), and a pin that the parser cap stays above the budget. Docs scope (flop-labs#450) untouched. Claude-Session: https://claude.ai/code/session_01MUnLjwckNcSN1mFUXsFLea
…p-labs#180) The GET write lanes carry their payload in the URL, so the binding limit is URL bytes, not the advertised `maxLength: 4096` character cap — 4096 CJK characters is a ~36 KiB URL. That budget was enforced only by uvicorn's h11 `--h11-max-incomplete-event-size`, which rejects an over-long request line only when it arrives across TCP segments, so the same over-budget URL 200s or 400s at random (flop-labs#180's measured ~20-67% coin flip above 16 KiB), and the 400 it produces is a bare origin `Invalid HTTP request received.` that names no length, no budget, and no escape. Make the budget the enforced contract: - app.py MAX_URL_BYTES (16 KiB): HeaderLimits now refuses an over-budget URL with a 414 in the app's own voice, naming the byte count and pointing at the POST body. Runs before routing, so the request never reaches a handler. - Dockerfile --h11-max-incomplete-event-size 16384 -> 32768, above the budget, so a just-over-budget request reaches the app for that clean 414 instead of dying opaquely in the parser. Trade-off documented at the CMD: worst-case per-connection incomplete-request-line buffer doubles to 32 KiB, bounded by --limit-concurrency to 4 MiB against a 128 MiB container. Tests: deterministic refusal at the boundary, the full-length CJK case (414 then POST carries it byte-exact), and a pin that the parser cap stays above the budget. Docs scope (flop-labs#450) untouched. Claude-Session: https://claude.ai/code/session_01MUnLjwckNcSN1mFUXsFLea
…p-labs#180) The GET write lanes carry their payload in the URL, so the binding limit is URL bytes, not the advertised `maxLength: 4096` character cap — 4096 CJK characters is a ~36 KiB URL. That budget was enforced only by uvicorn's h11 `--h11-max-incomplete-event-size`, which rejects an over-long request line only when it arrives across TCP segments, so the same over-budget URL 200s or 400s at random (flop-labs#180's measured ~20-67% coin flip above 16 KiB), and the 400 it produces is a bare origin `Invalid HTTP request received.` that names no length, no budget, and no escape. Make the budget the enforced contract: - app.py MAX_URL_BYTES (16 KiB): HeaderLimits now refuses an over-budget URL with a 414 in the app's own voice, naming the byte count and pointing at the POST body. Runs before routing, so the request never reaches a handler. - Dockerfile --h11-max-incomplete-event-size 16384 -> 32768, above the budget, so a just-over-budget request reaches the app for that clean 414 instead of dying opaquely in the parser. Trade-off documented at the CMD: worst-case per-connection incomplete-request-line buffer doubles to 32 KiB, bounded by --limit-concurrency to 4 MiB against a 128 MiB container. Tests: deterministic refusal at the boundary, the full-length CJK case (414 then POST carries it byte-exact), and a pin that the parser cap stays above the budget. Docs scope (flop-labs#450) untouched.
Fixes #180
State in the manual that the GET write lane is probabilistic above the URL budget.
What
The manual now explicitly says that GET writes are best-effort once the URL budget is exceeded.
Why
Issue #180. Callers were assuming GET writes are reliable under load; the reality is that they are dropped probabilistically once the budget is exceeded.
Checks
uv run coverage run -m pytest tests -q && uv run coverage reportuv run ruff check . && uv run ruff format --check .anduv run ty check