Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

jfposton
Copy link
Contributor

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

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(){
Copy link
Member

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

@romainneutron
Copy link
Contributor

As ProcessPipes have been introduced in 2.2, this PR should be done against branch 2.2

@@ -251,6 +251,10 @@ private function readFileHandles($close = false)
*/
private function readStreams($blocking, $close = false)
{
if(empty($this->pipes)){
return [];
Copy link
Contributor

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.

@ahilles107
Copy link

how about that issue? When it can be merged to 2.3 and released?

@fabpot
Copy link
Member

fabpot commented Nov 15, 2013

As mentioned by @romainneutron, this PR must be done on 2.2.

fabpot added a commit that referenced this pull request Nov 15, 2013
…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()
@fabpot fabpot closed this Nov 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The error "stream_select(): No stream arrays were passed" is being generated by ProcessPipes.php
6 participants