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

Re-enable unref in Deno #3701

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

lucacasonato
Copy link
Contributor

@lucacasonato lucacasonato commented Mar 15, 2024

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)

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()`.
Comment on lines +214 to +217
// 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()
Copy link
Contributor Author

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.

Comment on lines +680 to +684
// 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.
Copy link
Contributor Author

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.

@lucacasonato
Copy link
Contributor Author

@evanw Could you take a look at this?

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