You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adopt utility process for shared process and file watchers #154050
This is a follow up from #92164 and covers remaining work to eventually enable sandboxed renderers fully in Electron via app.enableSandbox().
This means that our shared process has to move away from a node.js enabled browser window to the new utility process.
Breaking down the usages today:
extension management
settings sync
profiles
terminals
file watcher
Some initial thoughts:
the shared process should probably just change to be a utility process as a first step
however, any code that relies on the browser window network stack instead has to leverage Electrons net APIs from the electron-main process to not loose proxy support
this can probably be done by implementing some kind of IRequestService that is backed by a main process service implementation
any child process has to decide whether it wants to lift up to a utility process off the main process or remain inside the shared process
To clarify: we can still have a shared process in the end, I do not have strong feelings, but it would be node.js only and not electron browser enabled. I think the benefit of having another process offload work from the main process is still valid.
One concern I have with shared process not having electron browser enabled is the network proxy and If we can enable request service to redirect to main as you mentioned, this shall be fine. But I am wondering how much load we gonna put on main and if that impacts perf.
Yes that is correct, the main process is only responsible for initiating the request from the JS thread, the actual work is done by the network utility process.
Some initial work landed on main and setting window.experimental.sharedProcessUseUtilityProcess to true will have the shared process run from a utility process, same as the file watcher.
There are some issues with integrated terminal that I cannot reproduce running out of sources but appear in the built version. But I was able to browse and install an extension.
changed the title [-]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`[/-][+]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`üpoiu9z88u9i`+#ü`üß[/+]on Feb 20, 2023
changed the title [-]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`üpoiu9z88u9i`+#ü`üß[/-][+]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`[/+]on Feb 20, 2023
I will close this one out for Feb since the significant portion of the work has already happened. Will create a new issue for moving terminals out, but for now they coexist as before.
changed the title [-]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`[/-][+]Adopt utility process for shared process and file watchers[/+]on Feb 24, 2023
Activity
sandy081 commentedon Jul 4, 2022
settings sync is safe to be removed as it does not use any non sandbox stuff like node apis.
bpasero commentedon Jul 4, 2022
To clarify: we can still have a shared process in the end, I do not have strong feelings, but it would be node.js only and not electron browser enabled. I think the benefit of having another process offload work from the main process is still valid.
sandy081 commentedon Jul 4, 2022
One concern I have with shared process not having electron browser enabled is the network proxy and If we can enable request service to redirect to main as you mentioned, this shall be fine. But I am wondering how much load we gonna put on main and if that impacts perf.
bpasero commentedon Jul 4, 2022
As far as I know, network load is handled from another utility process, so I think that should be fine, right Robo (@deepak1556) ?
deepak1556 commentedon Jul 4, 2022
Yes that is correct, the main process is only responsible for initiating the request from the JS thread, the actual work is done by the network utility process.
Tyriar commentedon Jul 4, 2022
For the terminal part in shared proc, it just passes manages the pty host process and passing requests to/from it, so good there.
#153182 seems like a blocker to enabling utility processes though.
bpasero commentedon Jul 6, 2022
Daniel Imms (@Tyriar) does #133895 still apply?
17 remaining items
bpasero commentedon Feb 16, 2023
Some initial work landed on
mainand settingwindow.experimental.sharedProcessUseUtilityProcesstotruewill have the shared process run from a utility process, same as the file watcher.There are some issues with integrated terminal that I cannot reproduce running out of sources but appear in the built version. But I was able to browse and install an extension.
[-]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`[/-][+]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`üpoiu9z88u9i`+#ü`üß[/+][-]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`üpoiu9z88u9i`+#ü`üß[/-][+]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`[/+]bpasero commentedon Feb 20, 2023
Terminal works as well now! It was just an issue where we passed an unsupported
execArgvto node.js viaforkbut took me days to actually find 🚀#174852
bpasero commentedon Feb 24, 2023
I will close this one out for Feb since the significant portion of the work has already happened. Will create a new issue for moving terminals out, but for now they coexist as before.
[-]Adopt utility process for shared process, file watchers and terminal host and set `app.enableSandbox()`[/-][+]Adopt utility process for shared process and file watchers[/+]