--extensions_require=extension1,extension2 does not wait correctly for extensions after the first in the list #7256
Labels
bug
extensions
Related to osquery extension SDK or to extensions themselves
triage
Issue needs to be verified, reproduced and prioritized
Bug report
What operating system and version are you using?
What version of osquery are you using?
What steps did you take to reproduce the issue?
ran osquery with two extensions using --extensions_require=extension1,extension2 --timeout=10
What did you expect to see?
Osquery wait a maximum of 10 seconds for all extensions to be loaded
What did you see instead?
Osquery failed to load all extensions with:
after less then 3 seconds.
It looks like in startExtensionManager in "osquery\osquery\extensions\extensions.cpp", after the first extension in the extensions_require list is loaded, all following extensions will be reported as failed to load after the first loop in applyExtensionDelay. This is because the waited bool is set to true after the first extension is checked, regardless of if it hit the FLAGS_extensions_timeout.
Also, rather than the FLAGS_extensions_timeout being the amount of time that all extensions are given to load, which seems to be what the waited bool is checking for, the applyExtensionDelay method resets the delay which is compared against the FLAGS_extensions_timeout for each extension. This could cause startExtensionManager to wait longer that the given timeout for all extensions to load.
The text was updated successfully, but these errors were encountered: