From 607792d38b77e32a700fce55939e94c692e8328a Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Thu, 29 Oct 2026 13:33:39 +0100 Subject: [PATCH] prevent hang by using non blocking reads --- CHANGELOG.md | 6 ++++++ src/Server/Process/Started.php | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b77e34..a459b25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Fixed + +- Iterating over a process output could result in a forever hang + ## 7.2.0 - 2026-08-09 ### Changed diff --git a/src/Server/Process/Started.php b/src/Server/Process/Started.php index 1e1cb5f..fbd3467 100644 --- a/src/Server/Process/Started.php +++ b/src/Server/Process/Started.php @@ -98,7 +98,8 @@ public function __construct( ->read() ->pool(Type::output) ->with(Type::error, $this->error->read()) - ->timeoutAfter(Period::millisecond(100)); + ->timeoutAfter(Period::millisecond(100)) + ->nonBlocking(); $this->timeout = $timeout; $this->content = $content; $this->pid = new Pid($this->status()['pid']);