Title: stream/iter merge() can hang when aborted during pending multi-source read · Issue #64012 · nodejs/node · GitHub
Open Graph Title: stream/iter merge() can hang when aborted during pending multi-source read · Issue #64012 · nodejs/node
X Title: stream/iter merge() can hang when aborted during pending multi-source read · Issue #64012 · nodejs/node
Description: Version main Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { merge } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; async function* pending() { await new Promise(() => {}); ...
Open Graph Description: Version main Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { merge } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; async function* p...
X Description: Version main Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { merge } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; a...
Opengraph URL: https://github.com/nodejs/node/issues/64012
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter merge() can hang when aborted during pending multi-source read","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS 26.5.0\n```\n\n### Subsystem\n\nstream\n\n### What steps will reproduce the bug?\n\n```js\nimport { merge } from 'node:stream/iter';\nimport { setTimeout } from 'node:timers/promises';\n\nasync function* pending() {\n await new Promise(() =\u003e {});\n}\n\nconst ac = new AbortController();\nconst iterator = merge(pending(), pending(), { signal: ac.signal })[Symbol.asyncIterator]();\n\nsetTimeout(100).then(() =\u003e ac.abort());\n\nconst result = await Promise.race([\n iterator.next().then(\n () =\u003e 'resolved',\n (error) =\u003e `rejected: ${error.name}`,\n ),\n setTimeout(500, 'hung'),\n]);\n\nconsole.log(result);\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe pending `iterator.next()` should reject, likely with `AbortError`, after the signal is aborted.\n\n### What do you see instead?\n\nThe script prints `hung`.\n\nThe multi-source `merge()` path waits on an internal promise while source reads are pending, but aborting the signal does not resolve that waiter. Since no source settles, the next abort check is never reached.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-06-19T23:25:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/64012/node/issues/64012"}
| 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:1d48221e-77a5-5f89-9207-db52d6899983 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88A4:3F74E:AF163D:EBE141:6A4D5158 |
| html-safe-nonce | b29a48720d3cb76c17791ee90879541d49217d18fcc5562ff55745dacf79cd6c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEE0OjNGNzRFOkFGMTYzRDpFQkUxNDE6NkE0RDUxNTgiLCJ2aXNpdG9yX2lkIjoiNjMyMDQ5ODcxNjY2Nzg5MjA1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 41b29b3aee6ce00357d65ab7b85de011efb02618ed8043ae22582affe636d017 |
| hovercard-subject-tag | issue:4704133871 |
| 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/64012/issue_layout |
| twitter:image | https://opengraph.githubassets.com/096cc90d60a75752097d3df4770daa334567c1b2adf9fce5f00441ece6679160/nodejs/node/issues/64012 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/096cc90d60a75752097d3df4770daa334567c1b2adf9fce5f00441ece6679160/nodejs/node/issues/64012 |
| og:image:alt | Version main Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { merge } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; async function* p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| 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 | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width