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

Move createAPIFactory to $init() of PluginManager #8872

Closed

Conversation

tsmaeder
Copy link
Contributor

@tsmaeder tsmaeder commented Dec 16, 2020

Signed-off-by: Thomas Mäder tmader@redhat.com

What it does

Fixes Timing issues when starting plugin hosts #8429 by moving the initialization of the ext-side services (for example in createAPIFactory to PluginManagerExtImpl#$init(). In this way, the main-side services (LanguagesMain, etc.) will already be listening when the services try to call them in their constructor (like in TasksExtImpl). Currently, the request to fetch task executions will be silently ignored.

How to test

  1. Build Theia
  2. Add a front-end and back-end plugin to the installation (for example https://github.com/eclipse/che-theia-samples/tree/master/samples/hello-world-frontend-plugin)
  3. Put a breakpoint on line 159 of hosted-plugin-process.ts
  4. Start debugging the back-end process (note that front-end plugins are still broken in the electron version, so remove the front end plugin before testing Frontend plugins are broken #6601)
  5. Make sure both plugins are activated correctly
  6. Make sure the breakpoint is not hit and the error message on that line is not in the log.

Review checklist

Reminder for reviewers

Signed-off-by: Thomas Mäder <tmader@redhat.com>
@tsmaeder tsmaeder marked this pull request as draft December 17, 2020 10:05
@tsmaeder
Copy link
Contributor Author

tsmaeder commented Dec 17, 2020

There are still some complications left here: for example, the WorkspaceMainImpl indirectly calls StorageExt#$updatePluginsWorkspaceData(...). In order to prevent timing issues, there should be a clean three-step initialisation phase:

  1. Set up main services, but don't assume ext services are there (except PluginManagerExt)
  2. Call PluginManagerExt#$init(). This sets up ext services in the plugin host: they may call main services at this time
  3. Start main services: they can assume all ext services are set up.

I probably won't be able to get anywhere before the holidays on this, so making WIP for the time being.

@JonasHelming JonasHelming added the decision_needed issues that require decisions on ways forward (ex: if they should be updated or closed) label Mar 2, 2022
@tsmaeder tsmaeder closed this Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision_needed issues that require decisions on ways forward (ex: if they should be updated or closed)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants