osquery-go
osquery-go copied to clipboard
Add mutexes to osquery-go
As discussed in #98, osquery's communication is single threaded. This PR adds several mechanisms to help manage that.
- Most critically, it adds mutexes to the underlying client calls to enforce that.
- It exposes the
Context
version of the underlying thrift library. Thrift documents some amount of retry logic, if contexts have deadlines, though I cannot tell if it works. It's also a little scaffolding to support using limiters - It adds a
WithClient
option toNewExtensionManagerServer
. The intent of this is to allow an application to reuse the same client for the client portions of server communication.
I'm probably willing to rework this to use a rate.Limiter
if people thought that was a better idea
Fixes: #98
Hrm. One caveat I see here, is that I've added mutexes, but not timeouts. Which strikes me as a somewhat dangerous.