René's URL Explorer Experiment


Title: http2: server sends RST_STREAM(NO_ERROR) without END_STREAM when the connection window is exhausted, truncating complete responses · Issue #66525 · nodejs/node · GitHub

Open Graph Title: http2: server sends RST_STREAM(NO_ERROR) without END_STREAM when the connection window is exhausted, truncating complete responses · Issue #66525 · nodejs/node

X Title: http2: server sends RST_STREAM(NO_ERROR) without END_STREAM when the connection window is exhausted, truncating complete responses · Issue #66525 · nodejs/node

Description: Version v26.10.0 (nghttp2 1.70.0); also reproduced on v26.5.1 and v24.18.0 (nghttp2 1.69.0). The code path is unchanged on main. Platform Darwin 25.6.0 arm64 Subsystem http2 What steps will reproduce the bug? Disclaimer: The following re...

Open Graph Description: Version v26.10.0 (nghttp2 1.70.0); also reproduced on v26.5.1 and v24.18.0 (nghttp2 1.69.0). The code path is unchanged on main. Platform Darwin 25.6.0 arm64 Subsystem http2 What steps will reprodu...

X Description: Version v26.10.0 (nghttp2 1.70.0); also reproduced on v26.5.1 and v24.18.0 (nghttp2 1.69.0). The code path is unchanged on main. Platform Darwin 25.6.0 arm64 Subsystem http2 What steps will reprodu...

Opengraph URL: https://github.com/nodejs/node/issues/66525

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"http2: server sends RST_STREAM(NO_ERROR) without END_STREAM when the connection window is exhausted, truncating complete responses","articleBody":"### Version\n\nv26.10.0 (nghttp2 1.70.0); also reproduced on v26.5.1 and v24.18.0 (nghttp2 1.69.0). The code path is unchanged on `main`.\n\n### Platform\n\n```text\nDarwin 25.6.0 arm64\n```\n\n### Subsystem\n\nhttp2\n\n### What steps will reproduce the bug?\n\nDisclaimer: The following research and reproduction were done together with Claude Opus 5.5\n\nSave as `repro.mjs` and run `node repro.mjs`. There are no dependencies and no TLS. A raw h2c client never sends WINDOW_UPDATE, so the 65535-byte connection window stays exhausted until the client reopens it after 300 ms.\n\n```js\nimport http2 from 'node:http2';\nimport net from 'node:net';\n\nconst server = http2.createServer();\nconst pending = {};\nserver.on('request', (req, res) => {\n  pending[req.url] = res;\n  if (!pending['/small'] || !pending['/big']) return;\n  // Once /small's body is on the wire, /big drains the 65535-byte connection window\n  // before /small's END_STREAM frame is submitted.\n  pending['/small'].stream.once('wantTrailers', () => pending['/big'].end('y'.repeat(1_000_000)));\n  pending['/small'].end('x'.repeat(1000));\n});\nif (process.env.RESUME) server.on('stream', (s) => s.resume());\n\n// Raw h2c client that never sends WINDOW_UPDATE, so the connection window stays at 0 once drained.\nconst frame = (type, flags, id, payload = Buffer.alloc(0)) => {\n  const h = Buffer.alloc(9);\n  h.writeUIntBE(payload.length, 0, 3);\n  h[3] = type; h[4] = flags; h.writeUInt32BE(id, 5);\n  return Buffer.concat([h, payload]);\n};\nconst lit = (idx, v) => Buffer.concat([Buffer.from([idx, v.length]), Buffer.from(v)]); // literal, indexed name, no huffman\nconst headers = (path) => Buffer.concat([Buffer.from([0x82, 0x86]), lit(0x04, path), lit(0x01, 'localhost')]); // GET, http\nconst TYPES = { 0: 'DATA', 1: 'HEADERS', 3: 'RST_STREAM', 4: 'SETTINGS', 6: 'PING', 7: 'GOAWAY', 8: 'WINDOW_UPDATE' };\n\nserver.listen(0, () => {\n  const sock = net.connect(server.address().port, 'localhost', () => {\n    sock.write(Buffer.concat([\n      Buffer.from('PRI * HTTP/2.0\\r\\n\\r\\nSM\\r\\n\\r\\n'),\n      frame(4, 0, 0),\n      frame(1, 0x5, 1, headers('/big')), // END_STREAM | END_HEADERS\n      frame(1, 0x5, 3, headers('/small')),\n    ]));\n  });\n  let buf = Buffer.alloc(0), small = [], done = false;\n  const finish = (verdict) => {\n    if (done) return;\n    done = true;\n    console.log(`node ${process.version} resume=${!!process.env.RESUME}: /small frames: ${small.join(', ')}\\n=> ${verdict}`);\n    process.exitCode = verdict.startsWith('OK') ? 0 : 1;\n    sock.destroy(); server.close();\n  };\n  sock.on('data', (d) => {\n    buf = Buffer.concat([buf, d]);\n    while (buf.length >= 9 && buf.length >= 9 + buf.readUIntBE(0, 3)) {\n      const len = buf.readUIntBE(0, 3), type = buf[3], flags = buf[4], id = buf.readUInt32BE(5) & 0x7fffffff;\n      const payload = buf.subarray(9, 9 + len);\n      buf = buf.subarray(9 + len);\n      if (type === 4 && !(flags & 1)) sock.write(frame(4, 1, 0)); // SETTINGS ack\n      if (id !== 3) continue;\n      const endStream = (type === 0 || type === 1) && flags & 1;\n      small.push(`${TYPES[type]}(${type === 0 ? `${len}B` : type === 3 ? `code=${payload.readUInt32BE(0)}` : 'headers'}${endStream ? ', END_STREAM' : ''})`);\n      if (endStream) finish('OK: response completed with END_STREAM');\n      if (type === 3) finish('BUG: full body received, then RST_STREAM without END_STREAM');\n    }\n  });\n  // Reopen the connection window later; a correct server sends /small's END_STREAM then.\n  const win = Buffer.alloc(4); win.writeUInt32BE(10_000_000);\n  setTimeout(() => sock.write(Buffer.concat([frame(8, 0, 0, win), frame(8, 0, 1, win)])), 300);\n  setTimeout(() => finish('TIMEOUT: /small never finished'), 2000);\n});\n```\n\nThe `wantTrailers` listener only makes the timing deterministic. In real traffic the same state comes about by itself whenever large responses use up the connection window while smaller responses on the same session finish.\n\n\n### How often does it reproduce? Is there a required condition?\n\nEvery time with the script above (5/5 on each version listed).\n\nRequired condition: a compat-API response (`Http2ServerResponse`, which always responds with `waitForTrailers: true`) whose request had no body. Its body has been sent, but the connection flow-control window is 0 when its empty END_STREAM DATA frame is submitted.\n\n\n### What is the expected behavior? Why is that the expected behavior?\n\n```text\nnode v26.10.0 resume=false: /small frames: HEADERS(headers), DATA(1000B), DATA(0B, END_STREAM)\n=> OK: response completed with END_STREAM\n```\n\nThe END_STREAM frame should wait for the window to open, then be sent. It does with `RESUME=1` (see below).\n\nRFC 9113 §8.1 only allows a server to send `RST_STREAM` with `NO_ERROR` *after* a complete response, \"i.e., a frame with the END_STREAM flag set\". Its purpose is to stop a request body the server doesn't need. Here the request already ended with its HEADERS frame, so there is nothing to abort.\n\n\n### What do you see instead?\n\n```text\nnode v26.10.0 resume=false: /small frames: HEADERS(headers), DATA(1000B), RST_STREAM(code=0)\n=> BUG: full body received, then RST_STREAM without END_STREAM\n```\n\nThe client gets the whole body, but the stream ends with a reset instead of END_STREAM, so it can't tell the response is complete. Firefox reports these as `NS_ERROR_NET_PARTIAL_TRANSFER` and discards the response. With `RESUME=1` the same script passes:\n\n```text\nnode v26.10.0 resume=true: /small frames: HEADERS(headers), DATA(1000B), DATA(0B, END_STREAM)\n=> OK: response completed with END_STREAM\n```\n\n\n### Additional information\n\n**Mechanism** (`lib/internal/http2/core.js`, `src/node_http2.cc`):\n\n1. The compat API responds with `waitForTrailers: true`. The body's last DATA frame goes out without END_STREAM, and `wantTrailers` → `sendTrailers({})` → `setImmediate(finishSendTrailers)` submits an empty DATA frame with END_STREAM (`Http2Stream::SubmitTrailers`).\n2. `finishSendTrailers` calls `stream[kMaybeDestroy]()`. The stream is `writableFinished`, has no trailers flag any more, `!didRead`, and `readableFlowing === null`. So it takes the \"gracefully close\" branch and calls `setImmediate(callStreamClose)` → `stream.close()` → `closeStream()` → `RST_STREAM(NO_ERROR)` straight away, because `writableFinished` is true.\n3. If the connection window is 0 at that moment, nghttp2 defers the empty END_STREAM DATA frame by flow control, even though it carries 0 bytes. RST_STREAM isn't flow-controlled, so it goes out first, and the deferred END_STREAM frame is dropped with the stream.\n\n**Native trace from a real server** (`NODE_DEBUG_NATIVE=HTTP2SESSION,HTTP2STREAM`, Vite dev server, Firefox). This is stream 207 of a session that was also sending 5 MB, 3 MB and 2.7 MB responses:\n\n```text\nHttpStream 207 ... submitting response\nHttp2Session server ... sending 3478 bytes for data frame on stream 207\nHttpStream 207 ... writable side shutdown\nHttp2Session server ... no more data for stream 207\nHttpStream 207 ... let javascript know we are ready for trailers\nHttpStream 207 ... sending 0 trailers\n   (~2300 log lines: ~50 more streams submit trailers, one WINDOW_UPDATE arrives, all of it goes to the multi-MB streams)\nHttp2Session server ... write finished with status 0\nHttpStream 207 ... sending rst_stream with code 0\nHttp2Session server ... stream 207 closed with code: 0\n```\n\nIn that capture, 88 of 335 streams had this sequence: \"no more data\" logged once instead of twice, END_STREAM never sent. All 88 matched the 88 `NS_ERROR_NET_PARTIAL_TRANSFER` failures Firefox reported across 3 page loads.\n\n**Workaround:** mark bodyless request streams as read, so the graceful-close branch is skipped and the stream closes normally after END_STREAM:\n\n```js\nserver.on('stream', (stream) => { if (stream.endAfterHeaders) stream.resume(); });\n```\n\n**Possible fixes** (not tested): skip the graceful close when the request side has already ended (`endAfterHeaders` / readable ended), since there is no request body to abort. Or defer the RST until the END_STREAM frame has actually been sent.\n\n**Impact:** Vite's dev server uses `http2.createSecureServer` with the compat API. Since Vite 7.2 it also does so when a proxy is configured, so Angular CLI dev servers are affected too. Large apps randomly fail to load modules in Firefox: vitejs/vite#21569, vitejs/vite#18182, vitejs/vite discussion #21574.\n","author":{"url":"https://github.com/iNaD","@type":"Person","name":"iNaD"},"datePublished":"2026-10-05T07:32:06Z","url":"https://github.com/nodejs/node/issues/66525"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2f22eca0-7118-4b66-3b07-1259912d140f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id93BE:3DE7C3:107B07:14DCD7:6B033860
html-safe-nonce0d90ca8342fc8eb8767e9ada5f1a6fffaf5a1c2b91906e4b70e90177a102fbe8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0JFOjNERTdDMzoxMDdCMDc6MTREQ0Q3OjZCMDMzODYwIiwidmlzaXRvcl9pZCI6IjQyMjk3OTQ0OTIzNjE3NDk0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5645d3fc08929db8fbe129e89325f3ef5bfab032967bf6960b769f169032cb59
hovercard-subject-tagissue:5708168194
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66525/issue_layout
twitter:imagehttps://opengraph.githubassets.com/20c9cab2f052874a35488c403ab4a241a820bcd245a3bc783f51d402331a2b2b/nodejs/node/issues/66525
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/20c9cab2f052874a35488c403ab4a241a820bcd245a3bc783f51d402331a2b2b/nodejs/node/issues/66525
og:image:altVersion v26.10.0 (nghttp2 1.70.0); also reproduced on v26.5.1 and v24.18.0 (nghttp2 1.69.0). The code path is unchanged on main. Platform Darwin 25.6.0 arm64 Subsystem http2 What steps will reprodu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameiNaD
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/66525#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F66525
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F66525
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/66525
Reloadhttps://github.com/nodejs/node/issues/66525
Reloadhttps://github.com/nodejs/node/issues/66525
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues637 (637)https://github.com/nodejs/node/issues
Pull requests668 (668)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/insights
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66525
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66525
http2: server sends RST_STREAM(NO_ERROR) without END_STREAM when the connection window is exhausted, truncating complete responseshttps://github.com/nodejs/node/issues/66525#top
http2Issues and PRs related to the http2 subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http2%22
https://github.com/iNaD
iNaDhttps://github.com/iNaD
on Oct 5, 2026https://github.com/nodejs/node/issues/66525#issue-5708168194
vitejs/vite#21569https://github.com/vitejs/vite/issues/21569
vitejs/vite#18182https://github.com/vitejs/vite/issues/18182
#21574https://github.com/nodejs/node/issues/21574
https://github.com/jordanade
jordanadehttps://github.com/jordanade
on Oct 5, 2026https://github.com/nodejs/node/issues/66525#issuecomment-5993870774
vitejs/vite#18248https://github.com/vitejs/vite/discussions/18248
efekrsklhttps://github.com/efekrskl
http2Issues and PRs related to the http2 subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http2%22
on Oct 7, 2026https://github.com/nodejs/node/issues/66525#event-32732035488
https://github.com/efekrskl
efekrsklhttps://github.com/efekrskl
on Oct 7, 2026https://github.com/nodejs/node/issues/66525#issuecomment-6048403138
#64265https://github.com/nodejs/node/pull/64265
#64663https://github.com/nodejs/node/pull/64663
https://github.com/barathraj048
barathraj048https://github.com/barathraj048
on Oct 10, 2026https://github.com/nodejs/node/issues/66525#issuecomment-6096642218
#64265https://github.com/nodejs/node/pull/64265
#64663https://github.com/nodejs/node/pull/64663
@efekrsklhttps://github.com/efekrskl
@iNaDhttps://github.com/iNaD
barathraj048https://github.com/barathraj048
on Oct 12, 2026https://github.com/nodejs/node/issues/66525#event-33021097264
http2: do not reset stream before END_STREAM is senthttps://github.com/barathraj048/node-js/commit/ec8c98c60bcc675cd733810062c390636aa9a23b
ec8c98chttps://github.com/barathraj048/node-js/commit/ec8c98c60bcc675cd733810062c390636aa9a23b
aduh95https://github.com/aduh95
on Nov 13, 2026https://github.com/nodejs/node/issues/66525#event-36017728712
http2: do not reset stream before END_STREAM is senthttps://github.com/nodejs/node/commit/d1a4cf7b23c607244e22357cb50695431c96b026
d1a4cf7https://github.com/nodejs/node/commit/d1a4cf7b23c607244e22357cb50695431c96b026
http2: do not reset stream before END_STREAM is senthttps://github.com/nodejs/node/commit/9f5ec47ce3bc7eecab9f1b359ceebd72d7ea4e07
9f5ec47https://github.com/nodejs/node/commit/9f5ec47ce3bc7eecab9f1b359ceebd72d7ea4e07
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/66525
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66525
http2Issues and PRs related to the http2 subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http2%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.