René's URL Explorer Experiment


Title: AbortSignal.any(): observed composites still accumulate in a long-lived source's kDependantSignals after #62367 (not GC-pruned) · Issue #64476 · nodejs/node · GitHub

Open Graph Title: AbortSignal.any(): observed composites still accumulate in a long-lived source's kDependantSignals after #62367 (not GC-pruned) · Issue #64476 · nodejs/node

X Title: AbortSignal.any(): observed composites still accumulate in a long-lived source's kDependantSignals after #62367 (not GC-pruned) · Issue #64476 · nodejs/node

Description: Follow-up to #62363 / #62367. #62367 ("defer AbortSignal.any() following") stops listener-less composites from following their sources eagerly. But a composite that is observed (has an abort listener) still follows its sources, and when ...

Open Graph Description: Follow-up to #62363 / #62367. #62367 ("defer AbortSignal.any() following") stops listener-less composites from following their sources eagerly. But a composite that is observed (has an abort listen...

X Description: Follow-up to #62363 / #62367. #62367 ("defer AbortSignal.any() following") stops listener-less composites from following their sources eagerly. But a composite that is observed (has an ab...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AbortSignal.any(): observed composites still accumulate in a long-lived source's kDependantSignals after #62367 (not GC-pruned)","articleBody":"Follow-up to #62363 / #62367.\n\n#62367 (\"defer `AbortSignal.any()` following\") stops **listener-less** composites from following their sources eagerly. But a composite that **is** observed (has an `abort` listener) still follows its sources, and when one of those sources is **long-lived**, the composite's entry accumulates in that source's `kDependantSignals` and is **not pruned even by a forced `global.gc()`**. `size` grows monotonically for as long as the process runs.\n\nReproduces on **v24.18.0** (which contains #62367), back on **v22.12.0**, and on the latest **v26.5.0** (`v8 14.6`).\n\n> **Note (edited after #64481):** My original wording said \"aborting or not doesn't matter; both leak\" but only attached the aborted repro. Both cases are shown below now (Repro A = aborted, Repro B = never aborted). They have different causes — see the Update at the bottom.\n\n### Version\n\n`v24.18.0` (`v8 13.6.233.17-node.50`), `v22.12.0` (`v8 12.4.254.21-node.21`), and `v26.5.0` (`v8 14.6.202.34-node.24`).\n\n### Platform\n\nmacOS (darwin), installed via nvm.\n\n### Subsystem\n\n`abortcontroller` / `lib/internal/abort_controller.js`\n\n### Repro A — composite is aborted\n\n```js\n// node --expose-gc reproA.mjs [shared|fresh]     (shared = long-lived source)\nconst mode = process.argv[2] || 'shared';\nconst longLived = new AbortController(); // never aborted; e.g. an app-lifetime \"shutdown\" signal\nconst N = 500_000;\n\nconst kDep = () => Object.getOwnPropertySymbols(longLived.signal)\n  .find((s) => s.toString() === 'Symbol(kDependantSignals)');\n\nfor (let i = 1; i \u003c= N; i++) {\n  const source = mode === 'shared' ? longLived : new AbortController();\n  const perReq = new AbortController();\n  const composite = AbortSignal.any([perReq.signal, source.signal]);\n  composite.addEventListener('abort', () => {}); // \"observed\": composite follows its sources\n  perReq.abort();                                 // settle, then discard composite/perReq\n  if (i % 100_000 === 0) {\n    globalThis.gc();                              // force a full GC\n    const sym = kDep();\n    console.log(`${i} iters | longLived.kDependantSignals.size = ${sym ? longLived.signal[sym].size : 0}`);\n  }\n}\nconsole.log(`node ${process.version} | v8 ${process.versions.v8} | mode=${mode}`);\n```\n\n```\n### mode=shared (long-lived source) ###\n100000 iters | longLived.kDependantSignals.size = 100000\n...\n500000 iters | longLived.kDependantSignals.size = 500000\n\n### mode=fresh (control) ###\n... size = 0 (flat)\n```\n\n### Repro B — composite is never aborted (normal-completion path)\n\n```js\n// node --expose-gc reproB.mjs\nconst longLived = new AbortController();\nconst N = 500_000;\nconst kDep = () => Object.getOwnPropertySymbols(longLived.signal)\n  .find((s) => s.toString() === 'Symbol(kDependantSignals)');\n\nfor (let i = 1; i \u003c= N; i++) {\n  const perReq = new AbortController();\n  const composite = AbortSignal.any([perReq.signal, longLived.signal]);\n  composite.addEventListener('abort', () => {}); // observed\n  // no abort() — the \"request\" just completes and the composite is dropped\n  if (i % 100_000 === 0) {\n    globalThis.gc();\n    const sym = kDep();\n    console.log(`${i} iters | longLived.kDependantSignals.size = ${sym ? longLived.signal[sym].size : 0}`);\n  }\n}\nconsole.log(`node ${process.version} | v8 ${process.versions.v8} | never-aborted`);\n```\n\n```\n### v26.5.0 — observed, never aborted ###\n100000 iters | longLived.kDependantSignals.size = 100000\n...\n500000 iters | longLived.kDependantSignals.size = 500000\n```\n\n### Expected behavior\n\nPer the DOM Standard, an `AbortSignal`'s **dependent signals** and **source signals** are each *\"a weak set\"*. Entries for composites that can no longer usefully fire should not accumulate indefinitely on a long-lived source.\n\n### What you see instead\n\n`kDependantSignals.size` on the long-lived source grows monotonically and is not reclaimed by a forced full GC. A fresh-source control (Repro A `mode=fresh`) stays flat at 0.\n\n### Version coverage\n\nBoth repros reproduce on v22.12.0, v24.6.0, v24.13.1, v24.18.0, and v26.5.0.\n\n---\n\n### Update (after #64481)\n\nThanks @bitpshr. The root cause for **Repro A** is `gcPersistentSignals` retaining the aborted composite — the abort path marks it aborted but never drops it, so on a long-lived source it's retained forever and its `WeakRef` never gets pruned. #64481 fixes that by dropping transitively-aborted dependents from `gcPersistentSignals`, which is the clear, actionable bug here.\n\nTo correct my original \"aborting or not doesn't matter\" wording — the two cases differ:\n\n- **Repro A (aborted):** the bug #64481 fixes. ✅\n- **Repro B (never aborted):** still accumulates (verified on v26.5.0 above). But I suspect this one may be **by design**: an observed composite whose source is still alive has to remain reachable so it can fire if the source aborts later, so `gcPersistentSignals` can't drop it while the source lives (cf. #64342). Flagging it only so it's a conscious call whether B is in-scope or expected — if it's expected/\"remove the listener\", that's a fine resolution and #64481 covers the actionable part.\n","author":{"url":"https://github.com/denghongcai","@type":"Person","name":"denghongcai"},"datePublished":"2026-07-13T17:26:45Z","url":"https://github.com/nodejs/node/issues/64476"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9bfee2db-3e77-cc44-ced7-b236ed696a81
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9688:274790:6B3430:91C591:6AED27E2
html-safe-nonce4b7762db8b84bf27874e2fa8ce664819db121acf198880f1aff1224df2bac653
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Njg4OjI3NDc5MDo2QjM0MzA6OTFDNTkxOjZBRUQyN0UyIiwidmlzaXRvcl9pZCI6IjUxMDE3OTMzNDk3NzczMDM1MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac523842fd492353dbe2236296f050bb73ae616f107326f9275a668f183cb9e685
hovercard-subject-tagissue:4876042889
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/64476/issue_layout
twitter:imagehttps://opengraph.githubassets.com/08fd181be615791c911d0bfa0369fb5fede916f2de2531fd5b245d31c5983594/nodejs/node/issues/64476
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/08fd181be615791c911d0bfa0369fb5fede916f2de2531fd5b245d31c5983594/nodejs/node/issues/64476
og:image:altFollow-up to #62363 / #62367. #62367 ("defer AbortSignal.any() following") stops listener-less composites from following their sources eagerly. But a composite that is observed (has an abort listen...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedenghongcai
hostnamegithub.com
expected-hostnamegithub.com
None9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2
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
release98b41fa4b5635ceb45a4c54320fced73817ff290
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/64476#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F64476
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%2F64476
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/64476
Reloadhttps://github.com/nodejs/node/issues/64476
Reloadhttps://github.com/nodejs/node/issues/64476
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues657 (657)https://github.com/nodejs/node/issues
Pull requests666 (666)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/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64476
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64476
#64481https://github.com/nodejs/node/pull/64481
AbortSignal.any(): observed composites still accumulate in a long-lived source's kDependantSignals after #62367 (not GC-pruned)https://github.com/nodejs/node/issues/64476#top
#64481https://github.com/nodejs/node/pull/64481
https://github.com/denghongcai
denghongcaihttps://github.com/denghongcai
on Jul 13, 2026https://github.com/nodejs/node/issues/64476#issue-4876042889
#62363https://github.com/nodejs/node/issues/62363
#62367https://github.com/nodejs/node/pull/62367
#62367https://github.com/nodejs/node/pull/62367
#62367https://github.com/nodejs/node/pull/62367
#64481https://github.com/nodejs/node/pull/64481
#64481https://github.com/nodejs/node/pull/64481
@bitpshrhttps://github.com/bitpshr
#64481https://github.com/nodejs/node/pull/64481
lib: fix AbortSignal.any() observed-composite leak #64481https://github.com/nodejs/node/pull/64481
doc: discourage AbortSignal cleanup for long-lived resources #64342https://github.com/nodejs/node/pull/64342
lib: fix AbortSignal.any() observed-composite leak #64481https://github.com/nodejs/node/pull/64481
https://github.com/denghongcai
denghongcaihttps://github.com/denghongcai
on Jul 13, 2026https://github.com/nodejs/node/issues/64476#issuecomment-4960802645
#62363https://github.com/nodejs/node/issues/62363
#62367https://github.com/nodejs/node/pull/62367
#62363https://github.com/nodejs/node/issues/62363
#62363https://github.com/nodejs/node/issues/62363
https://github.com/bitpshr
bitpshrhttps://github.com/bitpshr
on Jul 13, 2026https://github.com/nodejs/node/issues/64476#issuecomment-4961925644
#62363https://github.com/nodejs/node/issues/62363
bitpshrhttps://github.com/bitpshr
on Jul 26, 2026https://github.com/nodejs/node/issues/64476#event-28503735368
lib: fix AbortSignal.any() observed-composite leakhttps://github.com/bitpshr/node/commit/157c19a651fc3872d72b63181469b9e9c9b806a4
157c19ahttps://github.com/bitpshr/node/commit/157c19a651fc3872d72b63181469b9e9c9b806a4
nodejs-github-bothttps://github.com/nodejs-github-bot
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#64481https://github.com/nodejs/node/pull/64481
on Jul 29, 2026https://github.com/nodejs/node/issues/64476#event-28633697447
nodejs-github-bothttps://github.com/nodejs-github-bot
on Jul 29, 2026https://github.com/nodejs/node/issues/64476#event-28633697513
lib: fix AbortSignal.any() observed-composite leakhttps://github.com/nodejs/node/commit/6d0db4a556b6a60aa69286c4d80f3a60c05d65bd
6d0db4ahttps://github.com/nodejs/node/commit/6d0db4a556b6a60aa69286c4d80f3a60c05d65bd
aduh95https://github.com/aduh95
on Aug 3, 2026https://github.com/nodejs/node/issues/64476#event-28901687791
lib: fix AbortSignal.any() observed-composite leakhttps://github.com/nodejs/node/commit/a0fcc831737194d6a753d373b9b866eabee4d7f9
a0fcc83https://github.com/nodejs/node/commit/a0fcc831737194d6a753d373b9b866eabee4d7f9
lib: fix AbortSignal.any() observed-composite leakhttps://github.com/nodejs/node/commit/b95e5f9fd838b10404b0dfd19e9ad0a05abd3a4d
b95e5f9https://github.com/nodejs/node/commit/b95e5f9fd838b10404b0dfd19e9ad0a05abd3a4d
lib: fix AbortSignal.any() observed-composite leakhttps://github.com/nodejs/node/commit/19b9c14d600cc5fe6cbe56791e79986e033e1b62
19b9c14https://github.com/nodejs/node/commit/19b9c14d600cc5fe6cbe56791e79986e033e1b62
lib: fix AbortSignal.any() observed-composite leakhttps://github.com/nodejs/node/commit/06b54fe7d3ed2feefbc351c550caedf9ddc1a38d
06b54fehttps://github.com/nodejs/node/commit/06b54fe7d3ed2feefbc351c550caedf9ddc1a38d
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/64476
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64476
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

Viewport: width=device-width


URLs of crawlers that visited me.