Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax gc visitation on streams queued ReadRequest #1076

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Aug 28, 2023

There's no reason to gc visit the promise resolver here and it is potentially problematic if we do. Since the read requests are queued, if we gc visit it once, remove it from the queue, and gc happens to kick in before we access the resolver, then v8 could determine that the resolver is not reachable via tracing any more and free it before we can actually try to access the held resolver.

@jasnell jasnell requested a review from harrishancock August 28, 2023 17:17
src/workerd/api/streams/queue.h Outdated Show resolved Hide resolved
@jasnell jasnell force-pushed the jsnell/relax-gc-visit-streams-readrequest branch from 8c06b99 to 55e1738 Compare August 28, 2023 18:59
There's no reason to gc visit the promise resolver here and it is
potentially problematic if we do. Since the read requests are
queued, if we gc visit it once, remove it from the queue, and
gc happens to kick in before we access the resolver, then v8 could
determine that the resolver is not reachable via tracing any more
and free it before we can actually try to access the held resolver.
@jasnell jasnell force-pushed the jsnell/relax-gc-visit-streams-readrequest branch from 55e1738 to d193bcd Compare August 28, 2023 20:24
@jasnell
Copy link
Member Author

jasnell commented Aug 29, 2023

This passed internal CI. Windows github action appears to be persistently broken somehow completely unrelated to this fix. I ran windows build and test locally to verify so I'm going to go ahead and override the CI gate here and merge. There's another PR to try to figure out the Windows github issue.

@jasnell jasnell merged commit 09b2276 into main Aug 29, 2023
@jasnell jasnell deleted the jsnell/relax-gc-visit-streams-readrequest branch August 29, 2023 14:42
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