Title: http2: large queued request body prevents receiving an early response · Issue #66739 · nodejs/node · GitHub
Open Graph Title: http2: large queued request body prevents receiving an early response · Issue #66739 · nodejs/node
X Title: http2: large queued request body prevents receiving an early response · Issue #66739 · nodejs/node
Description: Version v26.10.0 Platform Darwin miki.local 25.6.0 Darwin Kernel Version 25.6.0: Sat Jul 11 15:27:04 PDT 2026; root:xnu-12377.161.13~4/RELEASE_ARM64_T6050 arm64 Subsystem http2 What steps will reproduce the bug? Save the following code i...
Open Graph Description: Version v26.10.0 Platform Darwin miki.local 25.6.0 Darwin Kernel Version 25.6.0: Sat Jul 11 15:27:04 PDT 2026; root:xnu-12377.161.13~4/RELEASE_ARM64_T6050 arm64 Subsystem http2 What steps will repr...
X Description: Version v26.10.0 Platform Darwin miki.local 25.6.0 Darwin Kernel Version 25.6.0: Sat Jul 11 15:27:04 PDT 2026; root:xnu-12377.161.13~4/RELEASE_ARM64_T6050 arm64 Subsystem http2 What steps will repr...
Opengraph URL: https://github.com/nodejs/node/issues/66739
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"http2: large queued request body prevents receiving an early response","articleBody":"### Version\n\nv26.10.0\n\n### Platform\n\n```text\nDarwin miki.local 25.6.0 Darwin Kernel Version 25.6.0: Sat Jul 11 15:27:04 PDT 2026; root:xnu-12377.161.13~4/RELEASE_ARM64_T6050 arm64\n```\n\n### Subsystem\n\nhttp2\n\n### What steps will reproduce the bug?\n\nSave the following code into a file and run it. For the 16MB request with the default session limit, node reports `ERR_HTTP2_STREAM_ERROR: Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM` rather than the 413.\n\n```js\n// A client that queues a large request body cannot read an early response.\n// Cleartext HTTP/2 (h2c), no dependencies: `node repro.mjs`.\nimport http2 from 'node:http2';\n\nconst server = http2.createServer();\nconst sessions = new Set();\nserver.on('session', (session) => sessions.add(session));\nserver.on('stream', (stream) => {\n stream.on('error', () => {}); // the client may reset the stream\n // Reject without reading the request body, as a server does for a 401 or 413.\n stream.respond({ ':status': 413 });\n stream.end('payload too large');\n});\nawait new Promise((resolve) => server.listen(0, resolve));\nconst origin = `http://localhost:${server.address().port}`;\n\nconst post = (bodyBytes, sessionOptions = {}) =>\n new Promise((resolve) => {\n const session = http2.connect(origin, sessionOptions);\n const req = session.request({ ':method': 'POST', ':path': '/' });\n req.on('response', (headers) => resolve(`status ${headers[':status']}`));\n req.on('error', (err) => resolve(`${err.code}: ${err.message}`));\n req.on('close', () => session.destroy());\n req.end(Buffer.alloc(bodyBytes)); // the whole body in one write\n });\n\nconst MiB = 1024 * 1024;\nconsole.log(`node ${process.version}`);\nconsole.log(' 8 MiB body: ', await post(8 * MiB));\nconsole.log('16 MiB body: ', await post(16 * MiB));\nconsole.log('16 MiB, maxSessionMemory 64 MB:', await post(16 * MiB, { maxSessionMemory: 64 }));\nfor (const session of sessions) session.destroy();\nserver.close();\n```\n\n### How often does it reproduce? Is there a required condition?\n\nTo reproduce, more than `maxSessionMemory` worth of request-body data must be queued when the response arrives.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nI'd expect consistent propagation of the server's 413 responses\n\n### What do you see instead?\n\nOpaque stream error (`ERR_HTTP2_STREAM_ERROR: Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM`) and no response\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/CoffeeFlux","@type":"Person","name":"CoffeeFlux"},"datePublished":"2026-10-14T19:32:31Z","url":"https://github.com/nodejs/node/issues/66739"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2ca799a6-5cfd-417d-a735-2db028c0d0ea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF68:21705E:EB5894:1450526:6AFBF54F |
| html-safe-nonce | d7b38e5d8b8e430743c38a4e20bc836385959e95b2e7968f8209a995bd2a8cab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjY4OjIxNzA1RTpFQjU4OTQ6MTQ1MDUyNjo2QUZCRjU0RiIsInZpc2l0b3JfaWQiOiIxOTM2MjEzNzQ4OTQzMTU2NTU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 49858b3dbc5824d6f1ade772f20308ca73ffdf11fb4684e8b2b19008aee7dd40 |
| hovercard-subject-tag | issue:5854310259 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66739/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6404b8f53c3d45420ba571b91a832787463fe03d001bf58b8a29e001c0a20249/nodejs/node/issues/66739 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6404b8f53c3d45420ba571b91a832787463fe03d001bf58b8a29e001c0a20249/nodejs/node/issues/66739 |
| og:image:alt | Version v26.10.0 Platform Darwin miki.local 25.6.0 Darwin Kernel Version 25.6.0: Sat Jul 11 15:27:04 PDT 2026; root:xnu-12377.161.13~4/RELEASE_ARM64_T6050 arm64 Subsystem http2 What steps will repr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CoffeeFlux |
| hostname | github.com |
| expected-hostname | github.com |
| None | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width