From 1949d85b6d71af2818ff68144304a98495628f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 19 Apr 2024 05:00:28 +0200 Subject: [PATCH] Fix loop getting stuck when launching a process fails on Windows (#72) Fixes #51, #71. Original patch: https://github.com/Nicodinus/amphp-process/commit/3d41ea5cf00b8cc5331b0fcf7bd27878cc72063a Co-authored-by: Aleksei Iarovoi --- lib/Internal/Windows/SocketConnector.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Internal/Windows/SocketConnector.php b/lib/Internal/Windows/SocketConnector.php index da5e250..3ba3ae6 100644 --- a/lib/Internal/Windows/SocketConnector.php +++ b/lib/Internal/Windows/SocketConnector.php @@ -365,6 +365,9 @@ public function onProcessConnectTimeout($watcher, Handle $handle) \proc_close($handle->proc); $handle->joinDeferred->fail($error); + + Loop::cancel($handle->childPidWatcher); + $handle->pidDeferred->fail($error); } public function registerPendingProcess(Handle $handle)