Skip to content

fix(fetch): preserve abort propagation after garbage collection - #6070

Merged
mcollina merged 1 commit into
mainfrom
BridgeAR/2026-10-21-abort-signal-gc
Oct 30, 2026
Merged

mcollina merged 1 commit into
mainfrom
BridgeAR/2026-10-21-abort-signal-gc

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Copied and cloned requests can lose cancellation after garbage collection because their signals do not keep the controllers that forward aborts alive.

Fixes: #4068

@codecov-commenter

codecov-commenter commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 91.63%. Comparing base (1f45224) to head (1b5ff84).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6070      +/-   ##
==========================================
+ Coverage   91.58%   91.63%   +0.04%     
==========================================
  Files         113      113              
  Lines       44001    43973      -28     
==========================================
- Hits        40298    40294       -4     
+ Misses       3703     3679      -24     

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copied and cloned requests can lose cancellation after garbage collection
because their signals do not keep forwarding controllers alive.

Native AbortSignal composition can retain finalization records while a
long-lived source survives on supported Node.js versions.

For 5,000 constructor copies of one retained parent, Node 24.20.0 / V8
13.6.233.17-node.53 improves from 35.37 us to 0.83 us per copy.
Two fresh processes use 50,000 warm-up operations and seven trials,
discarding the fastest and slowest.

Fixes: #4068
Refs: nodejs/node#62363
Signed-off-by: Ruben Bridgewater <ruben.bridgewater@datadoghq.com>
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-10-21-abort-signal-gc branch from ab719df to 1b5ff84 Compare October 22, 2026 08:15
@BridgeAR
BridgeAR marked this pull request as ready for review October 22, 2026 11:08

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloned requests loose abort signal on GC

4 participants