brettwooldridge / NuProcess

Low-overhead, non-blocking I/O, external Process implementation for Java
Apache License 2.0
718 stars 84 forks source link

Pipes leak on OSX #75

Closed bertmaher closed 7 years ago

bertmaher commented 7 years ago

This sample program leaks pipes until it crashes: https://gist.github.com/bertmaher/b3a54a6c4ed0eb5c52da91065af9d029. I think the problem is that closeStdin(true) tries to enqueue the process in the closeQueue, but that queue eventually fills up (and starts throwing, but the exception is swallowed by the method that calls onStart). Using closeStdin(false) solves the problem, but this behavior feels like a bug.

lfbayer commented 7 years ago

Thanks! It was super easy to reproduce with your code.

It looks like the issue was that we never actually pulled the items off of the queue, so it would only ever fill up. I've just released a 1.1.2 build that contains the fix.

bertmaher commented 7 years ago

Thank you for the quick fix!

lfbayer commented 7 years ago

It was a fun distraction 😄