lib: fix AbortSignal.any() with timeout signals#57867
Merged
nodejs-github-bot merged 4 commits intonodejs:mainfrom Apr 17, 2025
Merged
lib: fix AbortSignal.any() with timeout signals#57867nodejs-github-bot merged 4 commits intonodejs:mainfrom
nodejs-github-bot merged 4 commits intonodejs:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57867 +/- ##
========================================
Coverage 90.23% 90.24%
========================================
Files 630 630
Lines 185518 185726 +208
Branches 36369 36410 +41
========================================
+ Hits 167401 167604 +203
+ Misses 11005 10999 -6
- Partials 7112 7123 +11
🚀 New features to boost your workflow:
|
jasnell
approved these changes
Apr 14, 2025
Collaborator
atlowChemi
reviewed
Apr 15, 2025
Comment on lines
29
to
33
| const duration = Date.now() - start; | ||
|
|
||
| // Verify the timeout happened at approximately the right time (with some margin) | ||
| assert.ok(duration >= 8900, `Timeout happened too early: ${duration}ms`); | ||
| assert.ok(duration < 11000, `Timeout happened too late: ${duration}ms`); |
Member
There was a problem hiding this comment.
Do we really need this?
Can't we validate the reason is a timeout signal?
Member
Author
There was a problem hiding this comment.
Updated, does it look better?
atlowChemi
approved these changes
Apr 16, 2025
Collaborator
Collaborator
Collaborator
|
Landed in 9d6626a |
RafaelGSS
pushed a commit
that referenced
this pull request
May 1, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
RafaelGSS
pushed a commit
that referenced
this pull request
May 2, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 6, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 6, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
RafaelGSS
pushed a commit
that referenced
this pull request
May 14, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 16, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 17, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 17, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 17, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 18, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
aduh95
pushed a commit
that referenced
this pull request
May 19, 2025
PR-URL: #57867 Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
sholladay
added a commit
to sholladay/sky
that referenced
this pull request
Aug 7, 2025
The relevant bug was fixed upstream: nodejs/node#57867
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.
Fixes #57736
This PR fixes an issue where AbortSignal.any([AbortSignal.timeout(ms)]) would sometimes fail. The problem occurred because timeout signals inside a composite signal (created by AbortSignal.any()) were being garbage collected before they could fire.
I don't know how to make a simpler test for this honestly. Open to suggestions.
I used the following test to check for memory leaks. I assume that it works because when I initially made a mistake trying to fix this, it did cause a memory leak and it was reflected in this test:
After:
Before: