Skip to content

abort_controller: retain AbortSignal with registered listeners during gc#64415

Open
Phantom-d-e-v wants to merge 1 commit into
nodejs:mainfrom
Phantom-d-e-v:fix/abortsignal-gc-with-listener
Open

abort_controller: retain AbortSignal with registered listeners during gc#64415
Phantom-d-e-v wants to merge 1 commit into
nodejs:mainfrom
Phantom-d-e-v:fix/abortsignal-gc-with-listener

Conversation

@Phantom-d-e-v

Copy link
Copy Markdown

Per the DOM spec's "AbortSignal garbage collection" section, an AbortSignal with registered event listeners must not be garbage collected while those listeners are attached. Previously only timeout and non-empty composite signals were retained in gcPersistentSignals, so a signal that merely had a listener (e.g. the signal exposed by a fetch Request) could be collected while still in use, causing its listeners to silently stop firing after the owning object was gc'd.

Fixes: #55428

Per the DOM spec's "AbortSignal garbage collection" section, an
AbortSignal with registered event listeners must not be garbage collected
while those listeners are attached. Previously only timeout and non-empty
composite signals were retained in gcPersistentSignals, so a signal that
merely had a listener (e.g. the signal exposed by a fetch Request) could be
collected while still in use, causing its listeners to silently stop firing
after the owning object was gc'd.

Fixes: nodejs#55428
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request signal isn't aborted after garbage collection

2 participants