src: release context frame in AsyncWrap::EmitDestroy#61995
Open
Flarna wants to merge 3 commits intonodejs:mainfrom
Open
src: release context frame in AsyncWrap::EmitDestroy#61995Flarna wants to merge 3 commits intonodejs:mainfrom
Flarna wants to merge 3 commits intonodejs:mainfrom
Conversation
Release the async context frame in AsyncWrap::EmitDestroy to allow gc to collect it. This is in special relevant for reused resources like HTTPParser otherwise they might keep ALS stores alive.
391ae5a to
bdd2d38
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61995 +/- ##
==========================================
- Coverage 89.77% 89.73% -0.05%
==========================================
Files 674 676 +2
Lines 205705 205991 +286
Branches 39449 39488 +39
==========================================
+ Hits 184670 184838 +168
- Misses 13280 13298 +18
- Partials 7755 7855 +100
🚀 New features to boost your workflow:
|
addaleax
reviewed
Feb 26, 2026
src/async_wrap.cc
Outdated
| HandleScope handle_scope(env()->isolate()); | ||
| USE(object()->Set(env()->context(), env()->resource_symbol(), object())); | ||
| } | ||
| context_frame_.Reset(); |
Member
There was a problem hiding this comment.
Not for this PR, but do you know how it comes this is a v8::Global to begin with and not an internal field on object()?
Co-authored-by: Anna Henningsen <github@addaleax.net>
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.
Release the async context frame in
AsyncWrap::EmitDestroyto allow gc to collect it.This is in special relevant for reused resources like
HTTPParserotherwise they might keep ALS stores alive.Fixes: #61882
Refs: #48528