1
0
mirror of https://github.com/danog/process.git synced 2024-11-30 04:39:04 +01:00

Don't throw if process already terminated

This seems to be a race condition where the close pipe handler hasn't been called, but thee process already died.
This commit is contained in:
Niklas Keller 2018-07-11 23:23:25 +02:00
parent ab08b080fb
commit 083d5a8ed5

View File

@ -154,7 +154,9 @@ final class Runner implements ProcessRunner
}
if (!\proc_terminate($handle->proc, 9)) { // Forcefully kill the process using SIGKILL.
throw new ProcessException("Terminating process failed");
if (\proc_get_status($handle->proc)['running']) {
throw new ProcessException("Terminating process failed");
}
}
if ($handle->status < ProcessStatus::ENDED) {