-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Re-enable unref
in Deno
#3701
base: main
Are you sure you want to change the base?
Re-enable unref
in Deno
#3701
Conversation
This re-enables unref-by-default in Deno, and fixes the event loop starvation issue by explicitly re-ref'ing the esbuild sub-process when a user calls `stop()`.
// Ref the child process again, so that a user calling `close()` can await | ||
// the returned promise without the event loop starving because there are | ||
// no more ref'd async tasks. | ||
child.ref() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only new code. All other code is just a revert of 116f63e.
// You may also start esbuild once at the top level of your test suite (by | ||
// calling `initialize()`) instead of starting and stopping the esbuild process | ||
// for every test. This will not interfere with the resource sanitizer, and will | ||
// improve the efficiency of your tests because the esbuild process can be | ||
// reused between tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this paragraph to explain that you may also start esbuild outside of a Deno.test
call to avoid the resource sanitizer flagging it.
@evanw Could you take a look at this? |
This re-enables unref-by-default in Deno, and fixes the event loop starvation issue by explicitly re-ref'ing the esbuild sub-process when a user calls
stop()
.Background: #3682 (comment)