mirror of
https://github.com/danog/process.git
synced 2024-11-26 20:24:43 +01:00
Fix kill during startup on Windows
This commit is contained in:
parent
ff7d7612bb
commit
690d696dc9
@ -131,9 +131,12 @@ final class Runner implements ProcessRunner {
|
||||
throw new ProcessException("Terminating process failed");
|
||||
}
|
||||
|
||||
$failStart = false;
|
||||
|
||||
if ($handle->childPidWatcher !== null) {
|
||||
Loop::cancel($handle->childPidWatcher);
|
||||
$handle->childPidWatcher = null;
|
||||
$failStart = true;
|
||||
}
|
||||
|
||||
if ($handle->exitCodeWatcher !== null) {
|
||||
@ -142,8 +145,13 @@ final class Runner implements ProcessRunner {
|
||||
}
|
||||
|
||||
$handle->status = ProcessStatus::ENDED;
|
||||
|
||||
if ($failStart || $handle->stdioDeferreds) {
|
||||
$this->socketConnector->failHandleStart($handle, "The process was killed");
|
||||
} else {
|
||||
$handle->joinDeferred->fail(new ProcessException("The process was killed"));
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
public function signal(ProcessHandle $handle, int $signo) {
|
||||
|
@ -57,7 +57,7 @@ final class SocketConnector {
|
||||
unset($this->pendingClients[(int) $socket]);
|
||||
}
|
||||
|
||||
private function failHandleStart(Handle $handle, string $message, ...$args) {
|
||||
public function failHandleStart(Handle $handle, string $message, ...$args) {
|
||||
Loop::cancel($handle->connectTimeoutWatcher);
|
||||
|
||||
unset($this->pendingProcesses[$handle->wrapperPid]);
|
||||
|
Loading…
Reference in New Issue
Block a user