core icon indicating copy to clipboard operation
core copied to clipboard

use DispatchIO for Process.execute

Open tanner0101 opened this issue 7 years ago • 5 comments

This takes a shot at fixing #176 by using DispatchIO.

tanner0101 avatar Oct 17 '18 17:10 tanner0101

One thing that wasn't mentioned in the other issue but in the Discord discussion that presumed it is that those pipes should probably be closed manually after the child process exited. Otherwise, there's a risk of running out of file descriptors when a Vapor app calls external processes often.

vzsg avatar Oct 17 '18 17:10 vzsg

@vzsg yeah I think you're right. I've added code to close the read end of the pipes once the DispatchIO stream is closed.

tanner0101 avatar Oct 17 '18 18:10 tanner0101

Is there a way to reliably fail the older version of Process.asyncExecute in a test case, so we can verify that this PR fixes it?

calebkleveter avatar Oct 17 '18 18:10 calebkleveter

@calebkleveter I can't think of a way to do that reliably. :\ But maybe someone else does.

tanner0101 avatar Oct 17 '18 18:10 tanner0101

This fix is being held up by a bug with DispatchIO on Linux. I'm talking w/ Apple to see if there's anyway we can do about it.

tanner0101 avatar Oct 17 '18 20:10 tanner0101