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
Move extension host out of the workbench for process reuse #123592
Comments
Unless there are major objections, as a first step, I would try to spawn the extension host process from the shared process and establish a pipe between the extension host process and the renderer process using nodejs API. We can then remove this nodejs usage later when we get better support for IPC inside a sandboxed renderer. Given we will pipe things directly between the extension host process and the renderer process, I don't think there will be any extra load on the shared process. |
@alexdima Yeah that sounds like a good strategy to get going. This would reduce the sandbox related problem to switching from a node.js IPC solution to a sandbox compatible IPC mechanism 👍 One thing I was curious when I thought about how to move the extension host: currently a lot of extension host related code lives in PS: In my 1on1 with @rzhao271 yesterday we discussed to have a call with you on IPC solutions for the extension host once @deepak1556 is back from vacation (later this milestone). |
You're right. I took a quick glance at the process spawning code in
Maybe some of these imports disappear when I will try to move the code, but if I understand correctly, these imports are off-limit to code running in the shared process? Also, to set some expectations, I am sorry that I will only be able to work on the the sandbox effort after doing all my other plan items (so it gets a muscle again). |
If it makes things easier, maybe we decouple the layer-issue from the sandbox task. I see no problem with some code in shared process spawning a main-entry point that is defined by
And thus the layer thing would be a follow up issue to tackle as debt? I believe it would be nice to have a new layer specifically for the extension host and then push those things down to However, it looks like some of the dependencies are actually required to instantiate the extension host initially so even if we were to move all things to a new layer, that init data is still needed. I see this very similar to the way we start a remote extension host: we send some payload from the renderer to the remote extension host manager to start a new extension host. I wonder if this model should be the same for a sandboxed renderer: all these types are accessible in sandbox and the payload can be send over from the renderer to tell the shared process to spawn a new extension host. On the downside, this would mean we could not start an extension host at the same time we open a window, but to be honest, this would slow down the window significantly, so I am not sure we could even do that anyway, given how much we care about startup perf. |
@bpasero I took a look at how we do things in the remote case and I don't have so many concerns about the imports / layering, I think we should be able to eliminate most of the |
Fixed with 18cde69 |
Will continue in October given the recent revert. |
As part of #120431, we have to move the extension host out of the workbench.
Currently, the workbench is the parent of the extension host. When we do a reload, the workbench is recreated. When process reuse is enabled, the workbench PID stays the same throughout the reload, but the node environment is still taken down. Due to this cleanup, the child exit signal from the extension host is not handled, creating a zombie.
By moving the extension host out of the workbench, another longer-lived process can handle the signal instead.
@alexdima do you have any specific ideas as to how the new architecture should look?
The text was updated successfully, but these errors were encountered: