lib: fix AbortSignal.any() abort propagation - #66014
Open
inoway46 wants to merge 1 commit into
Open
Conversation
Follow composite signal sources at construction so abort state is propagated even without listeners, before sources can be collected. Keep the existing weak-reference finalization and timeout cleanup. Cover source collection before each state accessor, including nested composites, and cleanup of unreachable listener-less dependents. Fixes: nodejs#65995 Refs: nodejs#62363 Assisted-by: Codex Signed-off-by: inoway46 <inoueyuya416@gmail.com>
inoway46
marked this pull request as ready for review
September 13, 2026 11:14
ronag
approved these changes
Sep 13, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66014 +/- ##
==========================================
- Coverage 90.01% 90.00% -0.01%
==========================================
Files 785 785
Lines 269282 269330 +48
Branches 51288 51305 +17
==========================================
+ Hits 242381 242418 +37
- Misses 17401 17411 +10
- Partials 9500 9501 +1
🚀 New features to boost your workflow:
|
jasnell
approved these changes
Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
AbortSignal.any()losing its abort state when a source is garbage-collected before the composite is observed.Register dependencies at construction so abort state propagates without listeners, while preserving existing WeakRef and timeout cleanup.
In a 2-million-iteration churn test on macOS x64, RSS increased from ~52 MiB to 113–124 MiB without linear growth. After GC, dependent entries were zero and heap usage was ~4 MiB in both runs.
Fixes: #65995
Refs: #62363