Skip to content

Adopt utility process for shared process and file watchers #154050

Closed

Description

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

//cc Alexandru Dima (@alexdima)

Activity

  1. added
    plan-item
    shared-process
    sandbox
    on Jul 4, 2022
  2. sandy081 commented on Jul 4, 2022

    @sandy081
    Member

    settings sync is safe to be removed as it does not use any non sandbox stuff like node apis.

  3. bpasero commented on Jul 4, 2022

    @bpasero
    ContributorAuthor

    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.

  4. sandy081 commented on Jul 4, 2022

    @sandy081
    Member

    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.

  5. bpasero commented on Jul 4, 2022

    @bpasero
    ContributorAuthor

    As far as I know, network load is handled from another utility process, so I think that should be fine, right Robo (@deepak1556) ?

  6. deepak1556 commented on Jul 4, 2022

    @deepak1556
    Collaborator

    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.

  7. Tyriar commented on Jul 4, 2022

    @Tyriar
    Contributor

    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.

  8. bpasero commented on Jul 6, 2022

    @bpasero
    ContributorAuthor

    Daniel Imms (@Tyriar) does #133895 still apply?

  9. 17 remaining items

  10. bpasero commented on Feb 16, 2023

    @bpasero
    ContributorAuthor

    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.

  11. 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
  12. 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
  13. bpasero commented on Feb 20, 2023

    @bpasero
    ContributorAuthor

    Terminal works as well now! It was just an issue where we passed an unsupported execArgv to node.js via fork but took me days to actually find 🚀

    #174852

  14. bpasero commented on Feb 24, 2023

    @bpasero
    ContributorAuthor

    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.

  15. 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
  16. locked and limited conversation to collaborators on Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

on-testplanplan-itemsandboxshared-process

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions