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 to NewExtensionManagerServer. 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
As discussed in #98, osquery's communication is single threaded. This PR adds several mechanisms to help manage that.
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 limitersWithClient
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 ideaFixes: #98