Skip to content

Sandbox background process architectureΒ #116337

Closed

Description

From discussion today in standup here are suggestions for the sandbox architecture:

  • leverage the existing shared process as much as possible (make it robust, start fast and have logging for crashes)
  • keep main process usage as little as possible
  • aggressively move things over to shared process (e.g. logger, sqlite?)
  • investigate into turning the shared process into a lightweight node.js process with MessagePort support and access to Electron's proxy solution for network requests (if we cannot get proxy support here, we could think about doing ad-hoc hidden windows for network requests as a workaround)

image

Activity

  1. Tyriar commented on Feb 10, 2021

    @Tyriar
    Contributor

    Won't this delay terminal creation for several seconds after start up? That was the main reason for keeping this out of Shared Process. Is this temporary based on whether we can make it node or when we get message port support would be move it to be a child of main?

  2. bpasero commented on Feb 11, 2021

    @bpasero
    ContributorAuthor

    Daniel Imms (@Tyriar) once we let the shared process be the parent of the pty-host we will no longer delay startup. This can easily be controlled here:

    this.lifecycleMainService.when(LifecycleMainPhase.AfterWindowOpen).then(() => {
    this._register(new RunOnceScheduler(async () => {
    sharedProcess.spawn(await resolveShellEnv(this.logService, this.environmentService.args, process.env));
    }, 3000)).schedule();
    });

  3. bpasero commented on Feb 17, 2021

    @bpasero
    ContributorAuthor

    After discussion in the Electron sync yesterday, here is a revised diagram given Robo (@deepak1556) feedback that the new process architecture will not provide MessagePort support for child processes spawned from the shared process. That means, all communication from the window will have to go through the shared process and then into the child processes:

    image

  4. added
    feature-requestRequest for new features or functionality
    and removed
    under-discussionIssue is under discussion for relevance, priority, approach
    on Jun 15, 2021
  5. bpasero commented on Aug 25, 2021

    @bpasero
    ContributorAuthor

    Merged into #92164.

  6. locked and limited conversation to collaborators on Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalitysandboxRunning VSCode in a node-free environment

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions