zeroturnaround / zt-exec

ZeroTurnaround Process Executor
Apache License 2.0
883 stars 110 forks source link

Fix deadlock when process closes and inputstream not closed #34

Closed jjlauer closed 8 years ago

jjlauer commented 8 years ago

A experience deadlock when a process closes/dies when it has an attached inputstream #33 (that isn't System.in). I wrote a unit test that reproduces the problem and its included with this PR. In order to fix it, I had to clean up how stream pumper threads were created and made stopping them more reliable.

Feel free to copy n' paste my unit test if you want to see how the problem occurs before you see how I fixed it.

I also made all the variables in StreamPumperHandler to protected for folks to be able to subclass it.

reinra commented 8 years ago

Thanks for the pull request. I fixed the same issue with a bit of less changes.

jjlauer commented 8 years ago

@reinra

I tested the fix you pushed this morning and it seems to be working well.

Would it be possible to request a v1.9 be released soon? v1.8 is over a year old and these small couple changes would be helpful to be released publicly.

Thx.

reinra commented 8 years ago

Just released 1.9.