git-ecosystem / trace2receiver

GOLANG based OTEL custom collector receiver component for Trace2 data
MIT License
44 stars 7 forks source link

windows: use concurrent version of Accept() on Named Pipes #5

Closed jeffhostetler closed 1 year ago

jeffhostetler commented 1 year ago

Call l.Accept() from multiple concurrent goroutines and using the QueueSize-enabled version of go-winio to reduce/eliminate the need for clients to check for pipe-busy errors.

Force the use of my PR candidate version of Microsoft/go-winio.git in go.mod that defines QueueSize and creates concurrent listenerWorkers.

We need this more responsive version of the named pipe listener code so that rapidly arriving client connections do not get BUSY errors, because the client Trace2 code does not do busy-retry looping and just uses CreateFileW() to try to create a pipe.

TODO Currently, I have hard-coded this to my PR candidate build using a replace in go.mod. Later, this needs to be fixed to use an actual tagged version in Microsoft/go-winio (assuming they accept the PR) -- or, we need to consider creating an "internal" version in this repo.