Skip to content

Commit

Permalink
Check pid watcher has not already been cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 13, 2024
1 parent 1949d85 commit 187cdad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Internal/Windows/Handle.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct()
/** @var Deferred[] */
public $stdioDeferreds;

/** @var string */
/** @var string|null */
public $childPidWatcher;

/** @var string */
Expand Down
6 changes: 4 additions & 2 deletions lib/Internal/Windows/SocketConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,10 @@ public function onProcessConnectTimeout($watcher, Handle $handle)

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

Loop::cancel($handle->childPidWatcher);
$handle->pidDeferred->fail($error);
if ($handle->childPidWatcher !== null) {
Loop::cancel($handle->childPidWatcher);
$handle->pidDeferred->fail($error);
}
}

public function registerPendingProcess(Handle $handle)
Expand Down

0 comments on commit 187cdad

Please sign in to comment.