Skip to content

Use ReverseIoOwn in makeReentryCallback().#5655

Merged
kentonv merged 1 commit intomainfrom
kenton/fix-reentry-callback-ioown
Dec 8, 2025
Merged

Use ReverseIoOwn in makeReentryCallback().#5655
kentonv merged 1 commit intomainfrom
kenton/fix-reentry-callback-ioown

Conversation

@kentonv
Copy link
Copy Markdown
Member

@kentonv kentonv commented Dec 8, 2025

This ensures resources held by the callback can be freed more proactively when the IoContext shuts down, and also solves an unlikely scenario where the callback outlives the whole isolate (not just the IoContext), leading to a V8 fatal error.

This is difficult to reproduce. I have a load test I'm running that usually triggers this after a minute or two, which is obviously not appropriate for a unit test. But this change definitely fixes the problem. (The error doesn't appear ever to have happened in prod.)

@kentonv kentonv requested a review from danlapid December 8, 2025 03:13
@kentonv kentonv requested review from a team as code owners December 8, 2025 03:13
This ensures resources held by the callback can be freed more proactively when the IoContext shuts down, and also solves an unlikely scenario where the callback outlives the whole isolate (not just the IoContext), leading to a V8 fatal error.

This is difficult to reproduce. I have a load test I'm running that usually triggers this after a minute or two, which is obviously not appropriate for a unit test. But this change definitely fixes the problem.
@kentonv kentonv force-pushed the kenton/fix-reentry-callback-ioown branch from f9e7537 to d8cf680 Compare December 8, 2025 03:16
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 8, 2025

CodSpeed Performance Report

Merging #5655 will improve performances by 13.2%

Comparing kenton/fix-reentry-callback-ioown (d8cf680) with main (903cdf1)

Summary

⚡ 1 improvement
✅ 56 untouched
⏩ 30 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
Encode_ASCII_32[TextEncoder][0/0/32] 3.4 ms 3 ms +13.2%

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@kentonv kentonv merged commit 3378969 into main Dec 8, 2025
21 of 23 checks passed
@kentonv kentonv deleted the kenton/fix-reentry-callback-ioown branch December 8, 2025 14:53
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