René's URL Explorer Experiment


Title: Eagerly format default AbortController abort reasons to avoid retaining canceled work · Issue #66192 · nodejs/node · GitHub

Open Graph Title: Eagerly format default AbortController abort reasons to avoid retaining canceled work · Issue #66192 · nodejs/node

X Title: Eagerly format default AbortController abort reasons to avoid retaining canceled work · Issue #66192 · nodejs/node

Description: Could controller.abort() eagerly read the default reason’s stack, following the existing streams workaround and its original discussion? A retained signal can keep the canceled job alive through signal → reason → V8 stack → caller’s rece...

Open Graph Description: Could controller.abort() eagerly read the default reason’s stack, following the existing streams workaround and its original discussion? A retained signal can keep the canceled job alive through si...

X Description: Could controller.abort() eagerly read the default reason’s stack, following the existing streams workaround and its original discussion? A retained signal can keep the canceled job alive through si...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Eagerly format default AbortController abort reasons to avoid retaining canceled work","articleBody":"Could `controller.abort()` eagerly read the default reason’s stack, following the [existing streams workaround](https://github.com/nodejs/node/blob/v26.8.2/lib/internal/streams/destroy.js#L31-L35) and its [original discussion](https://github.com/nodejs/node/pull/34103#issuecomment-652002364)?\n\nA retained signal can keep the canceled job alive through `signal → reason → V8 stack → caller’s receiver`, including large buffers. This surfaced while investigating [jsdom window retention](https://github.com/jsdom/jsdom/issues/4337).\n\nRun this as an `.mjs` file with `node --expose-gc`. Verified on Node **v26.8.2**, Linux x64:\n\n```js\nimport { setImmediate } from \"node:timers/promises\";\n\nclass RenderJob {\n  input = Buffer.alloc(32 * 1024 * 1024, 1);\n  controller = new AbortController();\n\n  cancel() {\n    this.controller.abort();\n    return this.controller.signal;\n  }\n}\n\nasync function retainedMiB() {\n  for (let i = 0; i \u003c 5; ++i) {\n    await setImmediate();\n    global.gc();\n  }\n  return Math.round(process.memoryUsage().arrayBuffers / 1024 ** 2);\n}\n\n// Model dependencies retaining signals after the jobs are discarded.\nconst signals = Array.from({ length: 4 }, () => new RenderJob().cancel());\nconsole.log(await retainedMiB()); // 128\nconsole.log(signals.every(signal => signal.aborted)); // true\n\nfor (const signal of signals) void signal.reason.stack;\n\nconsole.log(await retainedMiB()); // 0\nconsole.log(signals.every(signal => signal.aborted)); // true\n```\n\nThe same signals and reasons remain alive throughout; reading their stacks releases all 128 MiB.\n\nI propose formatting only newly created default reasons, leaving caller-supplied reasons untouched. This preserves error identity and stack text with the default formatter. Formatting should follow abort notifications, and formatter exceptions should not escape `abort()`.\n\n\u003cdetails>\n\u003csummary>GPT-6 Astra Extra High's suggested diff\u003c/summary>\n\n```diff\n-  abort(reason = new DOMException('This operation was aborted', 'AbortError')) {\n-    abortSignal(this.#signal ??= new AbortSignal(kDontThrowSymbol), reason);\n+  abort(reason = undefined) {\n+    const signal = this.#signal ??= new AbortSignal(kDontThrowSymbol);\n+    if (signal[kAborted]) return;\n+\n+    const isDefaultReason = reason === undefined;\n+    if (isDefaultReason) {\n+      reason = new DOMException('This operation was aborted', 'AbortError');\n+    }\n+\n+    abortSignal(signal, reason);\n+\n+    if (isDefaultReason) {\n+      try {\n+        // Release references retained by V8's unformatted stack.\n+        // See https://github.com/nodejs/node/pull/34103#issuecomment-652002364\n+        reason.stack; // eslint-disable-line no-unused-expressions\n+      } catch {\n+        // A custom stack formatter must not make cancellation throw.\n+      }\n+    }\n   }\n```\n\n\u003c/details>\n\nThe tradeoffs are extra formatting work and earlier `Error.prepareStackTrace` execution. Custom formatters that retain call sites or throw may still retain the objects. This is the same compromise streams already makes.\n\nAlternately, if the Node.js team has good V8 contacts, it might be good to raise this with them. It's kind of ridiculous for large objects to be retained in this way all because of `Error.prepareStackTrace`, in my opinion.","author":{"url":"https://github.com/domenic","@type":"Person","name":"domenic"},"datePublished":"2026-09-22T01:21:57Z","url":"https://github.com/nodejs/node/issues/66192"}

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:2f59b6b3-a086-7a0c-d4d6-a69c7037e519
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE9EE:2984B8:A4BEF:E1E5F:6AED333B
html-safe-nonce6dd0932a2f88a2f41fd3372de1a6899fbf40233a6e9eb7298996e76a4bcbce44
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUVFOjI5ODRCODpBNEJFRjpFMUU1Rjo2QUVEMzMzQiIsInZpc2l0b3JfaWQiOiI2MTEzMzIxNjQ0NzgxODEwNDkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8c66369ffcafeec36302a528b561899a91b77e7c4a399bcd6a12ee0dfc994dca
hovercard-subject-tagissue:5534208906
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/66192/issue_layout
twitter:imagehttps://opengraph.githubassets.com/78aac231e99f5077fe2fa816d6f473e38ccc7b8154a0ab66ee0befa097771ab3/nodejs/node/issues/66192
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/78aac231e99f5077fe2fa816d6f473e38ccc7b8154a0ab66ee0befa097771ab3/nodejs/node/issues/66192
og:image:altCould controller.abort() eagerly read the default reason’s stack, following the existing streams workaround and its original discussion? A retained signal can keep the canceled job alive through si...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedomenic
hostnamegithub.com
expected-hostnamegithub.com
Nonee51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a
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
release59ebb7b901cc154ecc179a44f266fcf69f343b30
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/66192#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F66192
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%2F66192
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/66192
Reloadhttps://github.com/nodejs/node/issues/66192
Reloadhttps://github.com/nodejs/node/issues/66192
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues656 (656)https://github.com/nodejs/node/issues
Pull requests665 (665)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/66192
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66192
#66265https://github.com/nodejs/node/pull/66265
Eagerly format default AbortController abort reasons to avoid retaining canceled workhttps://github.com/nodejs/node/issues/66192#top
#66265https://github.com/nodejs/node/pull/66265
https://github.com/domenic
domenichttps://github.com/domenic
on Sep 22, 2026https://github.com/nodejs/node/issues/66192#issue-5534208906
existing streams workaroundhttps://github.com/nodejs/node/blob/v26.8.2/lib/internal/streams/destroy.js#L31-L35
original discussionhttps://github.com/nodejs/node/pull/34103#issuecomment-652002364
jsdom window retentionhttps://github.com/jsdom/jsdom/issues/4337
https://github.com/jasnell
jasnellhttps://github.com/jasnell
on Sep 22, 2026https://github.com/nodejs/node/issues/66192#issuecomment-5770963833
ronaghttps://github.com/ronag
on Oct 16, 2026https://github.com/nodejs/node/issues/66192#event-33484529035
lib: create the default abort reason without a stackhttps://github.com/ronag/node/commit/51251610b4723a8bd01f4a49da15f461b9fbfab4
5125161https://github.com/ronag/node/commit/51251610b4723a8bd01f4a49da15f461b9fbfab4
lib: speed up AbortSignalhttps://github.com/ronag/node/commit/b75ca9de618d8c2ec35e0e8b002b44e382beb188
b75ca9dhttps://github.com/ronag/node/commit/b75ca9de618d8c2ec35e0e8b002b44e382beb188
domenichttps://github.com/domenic
on Oct 17, 2026https://github.com/nodejs/node/issues/66192#event-33503311083
Release closed windows held by pending interceptorshttps://github.com/jsdom/jsdom/commit/b3227b38cad2879e8d0df9f8f385bf2a58839272
b3227b3https://github.com/jsdom/jsdom/commit/b3227b38cad2879e8d0df9f8f385bf2a58839272
Release closed windows held by pending interceptorshttps://github.com/jsdom/jsdom/commit/fab050e5f74f8ca621ce1e32c2bb8d5db79954a2
fab050ehttps://github.com/jsdom/jsdom/commit/fab050e5f74f8ca621ce1e32c2bb8d5db79954a2
nodejs-github-bothttps://github.com/nodejs-github-bot
on Oct 24, 2026https://github.com/nodejs/node/issues/66192#event-34145089381
lib: speed up AbortSignalhttps://github.com/nodejs/node/commit/6dea43a0f86c6d79ca6f849088189e900f770a47
6dea43ahttps://github.com/nodejs/node/commit/6dea43a0f86c6d79ca6f849088189e900f770a47
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/66192
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66192
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.