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

⭐ support ephemeral vs normal runtimes #2050

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Conversation

arlimus
Copy link
Member

@arlimus arlimus commented Oct 3, 2023

Ephemeral runtimes are used as throw-away runtimes, that come with their own plugin runner (and execution space). These runtimes can be thrown away after they are used, while other runtimes and plugins remain shared.

This is particularly useful when scanning targets with the discover mode, where potentially many runtimes/plugins need to be instantiated on the fly and are only required for the lifetime of the scan.

image

Ephemeral providers:

  1. Have their own plug instance that is not share with any other provider.
  2. They can be safely shut down, without impacting other providers.
  3. Ephemeral runtimes may spawn additional providers, which are shared in nature. On shutdown of ephemeral providers these shared providers are not closed.
  4. Non-ephemeral plugin instances are now only destroyed when the coordinator shuts down.

Fixes #2049

Ephemeral runtimes are used as throw-away runtimes, that come with their
own plugin runner (and execution space). These runtimes can be thrown
away after they are used, while other runtimes and plugins remain
shared.

This is particularly useful when scanning targets with the discover
mode, where potentially many runtimes/plugins need to be instantiated on
the fly and are only required for the lifetime of the scan.

Signed-off-by: Dominik Richter <[email protected]>
arlimus added a commit to mondoohq/cnspec that referenced this pull request Oct 3, 2023
We were already instantiating new runtimes for every asset that was
discovered. However, until the introduction of ephemeral runtimes, these
had the disadvantage that any runtime that was shut down would also shut
down the plug instance, which is shared.

In this new paradigm, we introduce explicitly ephemeral runtimes, which
are not shared. They have their own plugin instance that can safely be
shut down without impacting other providers.

For more details see: mondoohq/cnquery#2050

Signed-off-by: Dominik Richter <[email protected]>
Copy link
Member

@imilchev imilchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes the errors! thanks 🎉

@vjeffrey vjeffrey merged commit 62e4399 into main Oct 3, 2023
@vjeffrey vjeffrey deleted the dom/provider-sharing branch October 3, 2023 06:48
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v9: cnquery scan results in rpc errors
3 participants