google / mtail

extract internal monitoring data from application logs for collection in a timeseries database
Apache License 2.0
3.82k stars 378 forks source link

Reduce wait friction when reading from a pipe #878

Closed rideliner closed 2 months ago

rideliner commented 3 months ago

Uses logic similar to fileStream to circumvent waiting when there may be more to read immediately on a pipe.

google-cla[bot] commented 3 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

jaqx0r commented 2 months ago

Thanks for the idea! This is the real fix for #685 .

I've got some pending changes to the logstreams so I've applied a similar fix in my next PR.

jaqx0r commented 2 months ago

Unfortunately this PR contains a race condition in test by changing the arg to NewTest to zero. Fixing this isn't trivial.