deno
ea455081 - fix(ext/node): wire ConnectionsList hooks so headersTimeout doesn't spuriously fire (#34356)

Commit
51 days ago
fix(ext/node): wire ConnectionsList hooks so headersTimeout doesn't spuriously fire (#34356) The JS-based `ConnectionsList` introduced in #33208 (the `node:http` rewrite) defines `markHeadersCompleted()` and `popActive()` methods to mirror Node's native C++ binding, but only the initial `pushActive()` was ever called from `connectionListenerInternal` — the other two were defined and never invoked. Node's C++ wires these into the HTTP parser callbacks (`on_message_begin` / `on_headers_complete` / `on_message_complete`); the JS port forgot to do the same. As a result every server connection sat in `_active` with `headersCompleted: false` and a fixed `startTime`, so the 30s `checkConnections` watchdog fired a spurious `ERR_HTTP_REQUEST_TIMEOUT` about 60 seconds into any long-running request. Fastify's default `clientError` handler converts that error into HTTP 400, which is the user-visible regression. The fix mirrors Node's behavior in JS: `parser[kOnMessageBegin]` does popActive + pushActive (also covers the keepalive case so a second request on the same socket gets a fresh window), `parserOnIncoming` calls `markHeadersCompleted` once headers are parsed, and `resOnFinish` calls `popActive` when the response is done. Fixes #34297
Author
Parents
Loading