Title: AbortSignal.any() stops following a timeout signal once a listener is added to the timeout and removed, so the composite never aborts after a GC · Issue #66610 · nodejs/node · GitHub
Open Graph Title: AbortSignal.any() stops following a timeout signal once a listener is added to the timeout and removed, so the composite never aborts after a GC · Issue #66610 · nodejs/node
X Title: AbortSignal.any() stops following a timeout signal once a listener is added to the timeout and removed, so the composite never aborts after a GC · Issue #66610 · nodejs/node
Description: Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e1.mjs const sleep = ms => new Promise(resolve => setTimeout(reso...
Open Graph Description: Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e1.mjs const sleep = ms =...
X Description: Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e1.mjs const sleep = ms =...
Opengraph URL: https://github.com/nodejs/node/issues/66610
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AbortSignal.any() stops following a timeout signal once a listener is added to the timeout and removed, so the composite never aborts after a GC","articleBody":"### Version\n\nv26.10.0 and v26.11.1.\n\n### Platform\n\nLinux arm64.\n\n### Subsystem\n\nlib (abortcontroller)\n\n### What steps will reproduce the bug?\n\nRun `node --expose-gc repro.mjs`:\n\n```js\n// node --expose-gc e1.mjs\nconst sleep = ms => new Promise(resolve => setTimeout(resolve, ms));\nfor (const touch of [false, true]) {\n const composite = (() => {\n const timeout = AbortSignal.timeout(100);\n const made = AbortSignal.any([timeout]);\n if (touch) {\n const listener = () => {};\n timeout.addEventListener(\"abort\", listener);\n timeout.removeEventListener(\"abort\", listener);\n }\n return made;\n })();\n composite.addEventListener(\"abort\", () => {});\n await sleep(10);\n globalThis.gc();\n await sleep(300);\n console.log(`listener added and removed on the timeout: ${touch}; composite aborted: ${composite.aborted}`);\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways: 3 of 3 runs on each version. The timeout must have had a listener that was then removed, and a garbage collection must run before it fires.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`listener added and removed on the timeout: true; composite aborted: true`. A composite aborts when one of its sources does, whatever listeners came and went on the source.\n\n### What do you see instead?\n\n`composite aborted: false`: the timeout is collected before it fires, so the composite never aborts.\n\n### Additional information\n\n#57867 keeps a timeout that `AbortSignal.any()` follows in `gcPersistentSignals`. Removing the timeout's last abort listener seems to delete it from that set while a composite still follows it. We hit this in code that hands a timeout to `AbortSignal.any()` and also waits on the timeout itself, for example with `timers/promises`' `setTimeout(ms, value, { signal })`, which adds a listener and removes it.\n","author":{"url":"https://github.com/rinarakaki","@type":"Person","name":"rinarakaki"},"datePublished":"2026-10-08T17:28:25Z","url":"https://github.com/nodejs/node/issues/66610"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:20132c0e-3a89-292f-527b-aa31b68cdd88 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B4CE:169E62:7E6AF6:A3EAF8:6AED330D |
| html-safe-nonce | f11f5c7bac485af49a76a9bf96237956236c3ed96a1aef560a21c87e5b91038e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNENFOjE2OUU2Mjo3RTZBRjY6QTNFQUY4OjZBRUQzMzBEIiwidmlzaXRvcl9pZCI6Ijg1NjE0NzM2MzY1MjQ3MDA0MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 462cf8fdf362e7f76ca4fcf148681372df4b5ec3923f9212411b261da5aad575 |
| hovercard-subject-tag | issue:5766155522 |
| 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/66610/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e08d3241b99712a20bf12a6303541b8de83a5bd3938b53245f4224e7570ec3a0/nodejs/node/issues/66610 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e08d3241b99712a20bf12a6303541b8de83a5bd3938b53245f4224e7570ec3a0/nodejs/node/issues/66610 |
| og:image:alt | Version v26.10.0 and v26.11.1. Platform Linux arm64. Subsystem lib (abortcontroller) What steps will reproduce the bug? Run node --expose-gc repro.mjs: // node --expose-gc e1.mjs const sleep = ms =... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rinarakaki |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| 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 | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width