Brings origin/contrib down to develop: limits.maxConcurrentRequests, opt-in, applied per server and per Fetch adapter instance. Over the budget, a request gets 503 with Retry-After: 1 instead of queueing behind the ones already running.
Two commits from @hgshreyas, both DCO signed off:
ff94e55 feat: cap concurrent requests across runtimes
82e1678 fix: warn when connection limit drops a socket — Node's drop event was silent until now, so hitting maxConnections looked like a network fault from the outside. Rate-limited to one warning a minute.
The gate bounds concurrently executing handlers, not open connections: the slot is released when routing and the handler finish, so a long-lived stream or a WebSocket upgrade does not hold one for its lifetime. On Node a client disconnect releases the slot early. A handler that never returns keeps its slot, which is the honest behaviour for a budget of this shape.
contrib is a strict descendant of develop, so this merges without a conflict.
Both were filed against this branch rather than held against it, so it can land:
#73 — the shed request emits request:end with no request:start, the first pair in the tree to break. The decision owed is whether the pairing is a guarantee, not whether this PR is wrong.
#74 — the close listener and the acquire bookkeeping run on every request, including in apps that never set the limit.
Brings `origin/contrib` down to `develop`: `limits.maxConcurrentRequests`, opt-in, applied per server and per Fetch adapter instance. Over the budget, a request gets `503` with `Retry-After: 1` instead of queueing behind the ones already running.
Two commits from @hgshreyas, both DCO signed off:
- `ff94e55` feat: cap concurrent requests across runtimes
- `82e1678` fix: warn when connection limit drops a socket — Node's `drop` event was silent until now, so hitting `maxConnections` looked like a network fault from the outside. Rate-limited to one warning a minute.
The gate bounds *concurrently executing handlers*, not open connections: the slot is released when routing and the handler finish, so a long-lived stream or a WebSocket upgrade does not hold one for its lifetime. On Node a client disconnect releases the slot early. A handler that never returns keeps its slot, which is the honest behaviour for a budget of this shape.
`contrib` is a strict descendant of `develop`, so this merges without a conflict.
## Verified on ff94e55
lint 0 errors (48 pre-existing warnings)
complexity:check every function <= 25
typecheck clean
format:check clean
build clean
npm test 453 passed / 67 files
test:deno 12 passed
test:bun 7 passed
test:edge PASS
## Known follow-ups, deliberately let through
Both were filed against this branch rather than held against it, so it can land:
- #73 — the shed request emits `request:end` with no `request:start`, the first pair in the tree to break. The decision owed is whether the pairing is a guarantee, not whether this PR is wrong.
- #74 — the `close` listener and the acquire bookkeeping run on every request, including in apps that never set the limit.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Brings
origin/contribdown todevelop:limits.maxConcurrentRequests, opt-in, applied per server and per Fetch adapter instance. Over the budget, a request gets503withRetry-After: 1instead of queueing behind the ones already running.Two commits from @hgshreyas, both DCO signed off:
ff94e55feat: cap concurrent requests across runtimes82e1678fix: warn when connection limit drops a socket — Node'sdropevent was silent until now, so hittingmaxConnectionslooked like a network fault from the outside. Rate-limited to one warning a minute.The gate bounds concurrently executing handlers, not open connections: the slot is released when routing and the handler finish, so a long-lived stream or a WebSocket upgrade does not hold one for its lifetime. On Node a client disconnect releases the slot early. A handler that never returns keeps its slot, which is the honest behaviour for a budget of this shape.
contribis a strict descendant ofdevelop, so this merges without a conflict.Verified on
ff94e55Known follow-ups, deliberately let through
Both were filed against this branch rather than held against it, so it can land:
request:endwith norequest:start, the first pair in the tree to break. The decision owed is whether the pairing is a guarantee, not whether this PR is wrong.closelistener and the acquire bookkeeping run on every request, including in apps that never set the limit.