You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, When using Process::getIterator execution hangs regardless of the timeout value. This doesn't happen when using a callback supplied to Process::wait.
Shouldn't the getIterator method internally call checkTimeout?
A workaround is to call getIterator with the ITER_NON_BLOCKING flag, and manually call checkTimeout.
foreach ($process->getIterator(Process::ITER_NON_BLOCKING) as$type => $data) {
try {
$process->checkTimeout();
} catch (\Exception$err) {
break;
}
if (empty($data)) {
usleep(100);
continue;
}
// Handle data as usual
}
The text was updated successfully, but these errors were encountered:
…ng getIterator() (chalasr)
This PR was merged into the 3.1 branch.
Discussion
----------
[Process] Fix process continuing after reached timeout using getIterator()
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20594
| License | MIT
| Doc PR | n/a
Commits
-------
10992cd [Process] Fix kill process on reached timeout using getIterator()
As the title says, When using
Process::getIterator
execution hangs regardless of the timeout value. This doesn't happen when using a callback supplied toProcess::wait
.Shouldn't the
getIterator
method internally callcheckTimeout
?A workaround is to call
getIterator
with theITER_NON_BLOCKING
flag, and manually callcheckTimeout
.The text was updated successfully, but these errors were encountered: