brettwooldridge / NuProcess

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

ProcessKqueue.closeQueue filling up #74

Closed Lordshinjo closed 7 years ago

Lordshinjo commented 7 years ago

I'm on Sierra 10.12.4, though I don't believe the exact version should matter.

On Mac OS X, when creating processes and never writing anything to their stdin, the closeQueue of every ProcessKqueue will only accumulate processes, and never be emptied. This causes processes after 512 * numThreads to stop reporting their exits properly (BasePosixProcess.onExit leaves the happy path way too early).

It seems that processes are added to the closeQueue whenever they finish, but closeQueue is only drained when receiving a SIGUSR2, which only happens when queueing a write (or queueing a STDIN_CLOSED_PENDING_WRITE_TOMBSTONE).

To make it work, I could close each process' stdin right after starting them, but it doesn't look like I should have to.

lfbayer commented 7 years ago

I believe this was fixed with the fix for #75. Looks like they are the same issue.