Skip to content

Retain async context frames across scopes - #7096

Open
guybedford wants to merge 1 commit into
mainfrom
gbedford/async-context-frame-lifetime
Open

Retain async context frames across scopes#7096
guybedford wants to merge 1 commit into
mainfrom
gbedford/async-context-frame-lifetime

Conversation

@guybedford

Copy link
Copy Markdown
Contributor

This retains the previous async context frame while a scope temporarily replaces it.

AsyncContextFrame::Scope previously saved the prior frame as a borrowed reference. Replacing V8's continuation-preserved embedder data could make that frame unreachable, allowing GC to collect it before the scope restored it.

The saved frame is now an owning Ref. A regression test forces GC inside a nested scope and verifies the prior frame survives and is restored.

Tested with the default and all-autogates async-context test variants.

PR made with AI under my review

@guybedford
guybedford requested review from a team as code owners August 22, 2026 01:54
@ask-bonk

ask-bonk Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

@guybedford Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

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.

2 participants