fix: bound HTTP intake and response lifetimes

This commit is contained in:
2026-09-30 09:23:12 +09:00
parent f5034c0e4b
commit 780150d7ae
6 changed files with 364 additions and 106 deletions
+11 -5
View File
@@ -125,11 +125,17 @@ standard `POST /wip/v1/batch` route. `call_operation` is never batchable.
## Resource and failure behavior
`ResourceLimits` bounds request/response bytes, JSON nesting, batch items, file
read/write bytes, tree depth/node count, pinned handles, concurrent requests, and
a cooperative deadline. Advisory file-lock acquisition uses a nonblocking loop and
checks that deadline/cancellation rather than allowing a contended lock to stall
a worker. Tree traversal is breadth-first and opens only requested entries. Once a limit or depth boundary is reached it reads only far enough to
`ResourceLimits` bounds request/response bytes, HTTP request-head bytes, JSON
nesting, batch items, file read/write bytes, tree depth/node count, pinned handles,
and active connections/requests. One absolute request deadline covers header and
body intake, dispatch, cooperative filesystem work, and response transmission;
stalled clients are closed and cannot occupy a worker beyond that bound. Workers
accept connections directly, so the listener never moves more than the configured
concurrency into active userspace service. Advisory file-lock acquisition uses a
nonblocking loop and checks the same deadline/cancellation rather than allowing a
contended lock to stall a worker. Tree traversal is breadth-first and opens only
requested entries. Once a limit or depth boundary is reached it reads only far
enough to
prove whether an additional visible child exists, so `truncated` is true only
when something was actually omitted. I/O failure and cancellation remain errors,
not clean exhaustion.