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: uv loop polling when render process reuse enabled #25869
Conversation
0f29a52
to
0ceaae8
Compare
Busy looping is not a solution for listening to events. Apart from constant high CPU usage, when consuming streams it would add the delay for each chunk, making IO very slow. |
@zcbenz that does make sense and i don't think this is the ideal solution either - it's not clear to me what specifically is lacking in the previous approach though to make it hang in the way it was doing. Do you have any thoughts on an alternative? |
I have not looked into the issue, but it seems that the issue is caused by
|
0ceaae8
to
d9d5a25
Compare
@zcbenz determined the true underlying cause - updated the solution & PR body accordingly |
Can we get a test? |
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.
Test seems to be failing on mac CI:
Error: done() called multiple times
at IpcMainImpl.<anonymous> (electron/spec-main/api-browser-window-spec.ts:4301:11)
at Object.<anonymous> (electron/js2c/browser_init.js:157:8980)
aa20074
to
caa5bf9
Compare
caa5bf9
to
dcd075a
Compare
dcd075a
to
47c5e6b
Compare
I was unable to backport this PR to "9-x-y" cleanly; |
@codebytere has manually backported this PR to "11-x-y", please check out #25922 |
@codebytere has manually backported this PR to "10-x-y", please check out #25923 |
@codebytere has manually backported this PR to "9-x-y", please check out #25924 |
Description of Change
Closes #22119.
Closes #25314.
Closes #23910.
Closes #25405.
Closes #25496.
Fixes an issue where some Node.js module API calls hung in the renderer process on reload when renderer process reuse was in effect. This was happening because when render process reuse was enabled, Chromium reused the same process, but the main thread was still bound to the old iocp (on windows, and respective interface for other platforms) because libuv didn't destroy it. The queue then went on to operate on this old iocp - when we reloaded, a new iocp was created but not bound to the main thread and so we would not properly be informed of events on it. This is fixed by preparing the message loop on every reload when reuse is enabled with
node_bindings_->PrepareMessageLoop()
.cc @zcbenz @deepak1556
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where some Node.js module API calls hung in the renderer process after reloads when render process reuse was enabled.