Closed groob closed 6 years ago
For now, I handle this with a small loop:
for count < tries {
if _, err := os.Stat(*socketPath); os.IsNotExist(err) {
time.Sleep(time.Millisecond * 200)
count++
continue
}
}
This should really be fixed upstream by thrift since it asks for a timeout... https://github.com/kolide/osquery-go/blob/dc07ffdf186374c0a1328bb181e5f11d854508a2/transport/transport.go#L21
Digging further it appears that timeout is propagated all the way to stdlib net.DialTimeout but it still fails: https://github.com/apache/thrift/blob/d907cc92db5b93e699a4282e979d097ea863215a/lib/go/thrift/socket.go#L97
Thanks for this!
That timeout (Open
) is a time waiting for socket response. Our libraries should be implementing a timeout/retry check for the initial open as we race against the OS to make the socket available.
From @theopolis in slack: