New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Process] Check if the pipe array is empty before calling stream_select() #9367
Conversation
The pipe array is either set to null or is empty occasionally when readStreams() is called. This generates a warning frequently which can cause issues for custom shutdown functions. Adding a check to see if the pipe array is empty should be functionally equivalent without having to generate the error. Fixes: symfony#9280
|
||
class ProcessDoesNotThrowWarningTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testThatProcessDoesNotThrowWarningDuringRun(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests should be in the ProcessTest class
As |
@@ -251,6 +251,10 @@ private function readFileHandles($close = false) | |||
*/ | |||
private function readStreams($blocking, $close = false) | |||
{ | |||
if(empty($this->pipes)){ | |||
return []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use PHP 5.3 compatible notation as Symfony is compatible from 5.3.3.
how about that issue? When it can be merged to 2.3 and released? |
As mentioned by @romainneutron, this PR must be done on 2.2. |
…tream_select() (jfposton) This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9367). Discussion ---------- [Process] Check if the pipe array is empty before calling stream_select() | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #9280 | License | MIT | Doc PR | ProcessPipes generates a warning frequently which can cause issues for custom shutdown functions. Adding a check to see if the pipe array is empty should be functionally equivalent without having to generate the error. Fixes: #9280 Commits ------- 12f95e2 [Process] Check if the pipe array is empty before calling stream_select()
ProcessPipes generates a warning frequently which can cause issues for custom shutdown functions. Adding a check to see if the pipe array is empty should be functionally equivalent without having to generate the error.
Fixes: #9280