Hi osquery team, could u indicate the code of osqu...
# general
w
Hi osquery team, could u indicate the code of osquery controlling the the live query / schedule query running serially?
r
Distributed query waits for jobs is in one thread. Scheduler runs in its own thread. Each thread runs only one query at a time but the two threads may run concurrently with each other. There is no control per se.
w
well this is different from what i heard.
image.png
r
I believe that is what Stefano was trying to convey.
Out of curiosity, what are you trying to do that depends on this behavior?
w
so let me ask it in this way, can 2 live queries run simultaneously on host?
and can 2 scheduled queries run simultaneously on host?
r
I do not believe so. One distributed and one scheduled at a time.
w
so how does osquery implement this.
by running 2 independent threads to run live query and scheduled query respectively?
r
Yes.
w
so could u show me the code for details?
the code osquery starts 2 threads.
r
osquery/dispatcher/distributed_runner.cpp: Dispatcher::addService(std::make_shared<DistributedRunner>()); osquery/dispatcher/scheduler.cpp: Dispatcher::addService(std::make_shared<SchedulerRunner>(