osquery-go icon indicating copy to clipboard operation
osquery-go copied to clipboard

Add mutexes to osquery-go

Open directionless opened this issue 2 years ago • 1 comments

As discussed in #98, osquery's communication is single threaded. This PR adds several mechanisms to help manage that.

  1. Most critically, it adds mutexes to the underlying client calls to enforce that.
  2. 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
  3. 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

Fixes: #98

directionless avatar Apr 19 '22 21:04 directionless

Hrm. One caveat I see here, is that I've added mutexes, but not timeouts. Which strikes me as a somewhat dangerous.

directionless avatar Apr 23 '22 02:04 directionless