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

Sandbox: enable extension host communication #135268

Closed
bpasero opened this issue Oct 18, 2021 · 3 comments
Closed

Sandbox: enable extension host communication #135268

bpasero opened this issue Oct 18, 2021 · 3 comments
Assignees
Labels
extension-host Extension host issues plan-item VS Code - planned item for upcoming sandbox Running VSCode in a node-free environment

Comments

@bpasero
Copy link
Member

bpasero commented Oct 18, 2021

This is the continuation of #123592

The extension host is no longer forked off the renderer but it still uses node.js for communication. We need a solution that scales for the amount of data that is coming in and going out between renderer and extension host. In other words, we should not send the data through the shared process message port.

This is similar to what the file watcher had to go through and I ended up pushing for a node.js enabled web worker solution, which means:

  • the shared process creates node.js enabled web workers
  • the web worker owns one part of the message port end point
  • the web worker forks processes and proxies all communication via the message port to the receiver
  • the other end of the message port is sent back to the renderer

I believe the extension host could use a similar model, provided that the runtime behaviour of a process from a node.js enabled web worker is identical to a process forked off a node.js enabled window. Maybe @deepak1556 could verify that assumption.

@bpasero bpasero added plan-item VS Code - planned item for upcoming extension-host Extension host issues sandbox Running VSCode in a node-free environment labels Oct 18, 2021
@deepak1556
Copy link
Collaborator

I believe the extension host could use a similar model, provided that the runtime behaviour of a process from a node.js enabled web worker is identical to a process forked off a node.js enabled window.

Yup they are similar, the underlying fork syscall just happens to be triggered on a different thread but the process information copied are all similar to that when being spawned in the current model of extension host, only the thread related information will be different but we are not interested in those data from the child process.

@bpasero
Copy link
Member Author

bpasero commented Oct 18, 2021

In my opinion there are so many problems with fork(2) in multi-threaded programs that it's almost impossible to do it right.

🐙

@joaomoreno joaomoreno changed the title Sandbox: enable extension host communiction Sandbox: enable extension host communication Jun 8, 2022
@bpasero bpasero added this to the June 2022 milestone Jun 19, 2022
@deepak1556 deepak1556 removed this from the June 2022 milestone Jun 30, 2022
@deepak1556
Copy link
Collaborator

Completed in #150753

@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extension-host Extension host issues plan-item VS Code - planned item for upcoming sandbox Running VSCode in a node-free environment
Projects
None yet
Development

No branches or pull requests

4 participants
@bpasero @deepak1556 @alexdima and others