-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
--extensions_require
does not exit on fail, and keeps trying to load bad extension
#8254
Comments
If the extension fails to load, it should sleep instead of trying again. sleep can be added here: osquery/osquery/extensions/impl_thrift.cpp Line 268 in 612656b
|
I wouldn't put the sleep so deep; that's more a generic interface toward thrift. That being said, there are two pieces at play here, the watcher/watchdog which attempts to start the extensions passed via The watcher starts the extensions and if they die, they get restarted immediately, or at least it attempts to, but limits itself and warns about the fact that the extension is being restarted too quickly. osquery/osquery/core/watcher.cpp Line 390 in 612656b
Then you have the worker which waits for the extensions to be registered before proceeding with its own initialization internally, because if the extensions are providing some fundamental feature (like a config or logging plugin), then that will cause failures for sure in the worker. Line 655 in 612656b
But worker and watcher do not communicate in this. Furthermore, I'm not sure that If an extension is providing a fundamental feature, like a config or logger plugin which is enabled via flags, osquery will fail anyway to enable them, and will exit. I would also consider this desire here: #8067 EDIT: Oh and the definition of "bad extension" I think needs to be clarified. When the watcher is launching a managed extension, it restarts it if it exits, but doesn't know why it exited. |
Yes, I agree that I opened a PR to change warnings to errors when extension could not be added: #8260 |
If the tables are used for decorators, one might want this on table extensions |
Bug report
When I try to load a bad extension, like:
./osqueryi --extensions_autoload=/Users/victor/work/fleet/extensions.load --extensions_require=example_extension,example_extension2
osquery does not exit. Instead, it keeps trying to reload the extension every 2 seconds, giving me warnings. Setting
extensions_timeout
andextensions_interval
do not change the behavior.This issue is somewhat related to #7256 since they touch the same code.
What operating system and version are you using?
macOS
What version of osquery are you using?
5.11.0
What steps did you take to reproduce the issue?
What did you expect to see?
I expect osquery to exit if
--extensions_require
is not satisfied.I expect osquery to not keep trying to reload a bad extension.
What did you see instead?
The text was updated successfully, but these errors were encountered: