Improve shutdown speed during initialization by Smjert · Pull Request #7106 · os...
source link: https://github.com/osquery/osquery/pull/7106
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
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
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()) {
osquery/events/eventfactory.cpp
Outdated
@@ -427,6 +428,10 @@ void EventFactory::delay() {
return;
}
if (shutdownRequested()) {
Could you combine this check and the check in attachEvents
into a single check within Initializer::start
?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No one assigned
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK