Title: stream/iter: writer.fail(0) can leave async iterator readers pending forever · Issue #63568 · nodejs/node · GitHub
Open Graph Title: stream/iter: writer.fail(0) can leave async iterator readers pending forever · Issue #63568 · nodejs/node
X Title: stream/iter: writer.fail(0) can leave async iterator readers pending forever · Issue #63568 · nodejs/node
Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; const { writer, readable } = push(); const reader = read...
Open Graph Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; const { writer, ...
X Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; ...
Opengraph URL: https://github.com/nodejs/node/issues/63568
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter: writer.fail(0) can leave async iterator readers pending forever","articleBody":"### Version\n\n26.2.0\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 { push } from 'node:stream/iter';\nimport { setTimeout } from 'node:timers/promises';\n\nconst { writer, readable } = push();\nconst reader = readable[Symbol.asyncIterator]();\n\nwriter.fail(0);\n\nconst result = await Promise.race([\n reader.next().then(\n (value) =\u003e ({ type: 'settled', value }),\n (reason) =\u003e ({ type: 'rejected', reason }),\n ),\n setTimeout(100, { type: 'timeout' }),\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\n```console\n{ type: 'rejected', reason: 0 }\n```\n`next()` should reject with the stored failure reason, including falsy values such as `0` or `false`, because `fail(reason)` accepts any value.\n\n### What do you see instead?\n\n```console\n{ type: 'timeout' }\n```\nAfter calling `writer.fail(0)`, a subsequent `readable[Symbol.asyncIterator]().next()` does not settle and the repro times out.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-05-25T20:56:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63568/node/issues/63568"}
| 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:ade8299c-89d6-6477-a0de-08edcbebda7c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE92:348CFA:45C314:638679:6A4CA2ED |
| html-safe-nonce | 9c69b9ef017062734efddc0b16cc62c9dd57f04110c1cd8ce74638e124d9a057 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTkyOjM0OENGQTo0NUMzMTQ6NjM4Njc5OjZBNENBMkVEIiwidmlzaXRvcl9pZCI6Ijg3NDI2NTI2ODI5NTc1Mjk4MzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | de8bdd42b5e5909c100d26ec6cc5be29357717b6e45b198321503e176ebae928 |
| hovercard-subject-tag | issue:4519486887 |
| 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/63568/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee70086aa730da5c94c2b7a0cd5d12d2c08a11d9384dd9c90ce9b021cab21a67/nodejs/node/issues/63568 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee70086aa730da5c94c2b7a0cd5d12d2c08a11d9384dd9c90ce9b021cab21a67/nodejs/node/issues/63568 |
| og:image:alt | Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; import { setTimeout } from 'node:timers/promises'; const { writer, ... |
| 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 | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| 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 | ae90d426644ca15e89bacceb72e51f4e9dbf85f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width