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

Improve shutdown speed during initialization #7106

Merged

Conversation

Smjert
Copy link
Member

@Smjert Smjert commented May 14, 2021

Interrupt the extension plugin initialization retry loop
as soon as the request to shutdown is received.
Also attempt to avoid doing any additional work along the path
of initialization.

Related to #7068

Interrupt the extension plugin initialization retry loop
as soon as the request to shutdown is received.
Also attempt to avoid doing any additional work along the path
of initialization.
@Smjert Smjert added extensions Related to osquery extension SDK or to extensions themselves core labels May 14, 2021
@Smjert Smjert requested review from a team as code owners May 14, 2021 16:58
@theopolis
Copy link
Member

What about focusing on the Initializer::start method itself as the place where shutdownRequested is checked before each step? I think that is easier to understand, when any new initialization work done there, that should also perform a check.

For example, instead of checking shutdownRequested in Registry::setUp, we check within Initializer::start before calling Registry::setUp.

@@ -224,6 +225,10 @@ std::string RegistryFactory::getActive(const std::string& registry_name) const {
}

void RegistryFactory::setUp() {
if (shutdownRequested()) {
Copy link
Member

Choose a reason for hiding this comment

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

@@ -427,6 +428,10 @@ void EventFactory::delay() {
return;
}

if (shutdownRequested()) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you combine this check and the check in attachEvents into a single check within Initializer::start?

@Smjert Smjert merged commit 5abaa76 into osquery:master May 26, 2021
@Smjert Smjert deleted the stefano/improvement/init-respect-shutdown branch June 8, 2021 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core extensions Related to osquery extension SDK or to extensions themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants