-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix(core): keep event loop alive if there are ticks scheduled #12814
Conversation
Demonstrates that nextTick() callbacks aren't invoked when there isn't anything else keeping the event loop alive. Specifically: 1. nextTickCallback is invoked, but 2. macrotaskCallback is not
The test is passing after the second commit but I'm sorta confused: the "has tick scheduled" flag is still true but the event loop exits because the macrotask callback says it's done. Is that expected behavior? |
I forgot to account for next ticks in keeping event loop alive. We should add an additional check here: Lines 804 to 822 in c82ce74
|
@bnoordhuis PTAL |
LGTM but I can't approve my own PRs. =) |
See denoland#12771 and denoland#12814. Needed to reland denoland#12908, which was reverted in denoland#12929.
Demonstrates that nextTick() callbacks aren't invoked when there isn't
anything else keeping the event loop alive. Specifically: