Skip to content

Commit

Permalink
Fix loop getting stuck when launching a process fails on Windows
Browse files Browse the repository at this point in the history
Fixes amphp#51, amphp#71.

Original patch:
Nicodinus@3d41ea5
  • Loading branch information
Nicodinus authored and MatmaRex committed Feb 27, 2024
1 parent 04b4517 commit 3bb6784
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Internal/Windows/SocketConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ public function onProcessConnectTimeout($watcher, Handle $handle)
\proc_close($handle->proc);

$handle->joinDeferred->fail($error);

if ($handle->status === ProcessStatus::STARTING) {
Loop::cancel($handle->childPidWatcher);
$handle->pidDeferred->fail($error);
}
}

public function registerPendingProcess(Handle $handle)
Expand Down

0 comments on commit 3bb6784

Please sign in to comment.