On a fresh start-up of D6 + Advagg, with NO stored/cached data in /files/advagg_css + /files/advagg_js folders I regularly see this typical D6 report:

Warning: stream_select() [<a href='function.stream-select'>function.stream-select</a>]: No stream arrays were passed in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).

Warning: stream_select(): 163 is not a valid stream resource in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).

Once advagg builds the aggregate 'bundles' this report no longer occurs!
The above report occurs whenever the /files/advagg_css + /files/advagg_js folders are 'empty' = null!


I am sure this just means advagg could deal out some nicer error handling!
Many thanks for a great performance tool/ module. It gets better hourly!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Status: Active » Needs review
FileSize
508 bytes

How reliably can you repo this bug? Try this, it will change the default timeout to be 30 seconds when using stream_select.

Peter Bowey’s picture

Refer #1

Easy to 'reproduce', I just clear the advagg_js + advagg_css directories, then purge the Edgecast CDN.
I also reboot the Linux Box. (this clears Linux Memcached Daemon...:)
I will test that timeout increase now!

Peter Bowey’s picture

With #1 timeout change 1 -> 30 = same issue: (this is after A COLD everything)

    Warning: stream_select(): 112 is not a valid stream resource in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select(): 112 is not a valid stream resource in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select() [<a href='function.stream-select'>function.stream-select</a>]: No stream arrays were passed in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select(): 112 is not a valid stream resource in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select(): 112 is not a valid stream resource in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select() [<a href='function.stream-select'>function.stream-select</a>]: No stream arrays were passed in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select(): 112 is not a valid stream resource in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select(): 112 is not a valid stream resource in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
    Warning: stream_select() [<a href='function.stream-select'>function.stream-select</a>]: No stream arrays were passed in advagg_async_send_http_request() (line 2939 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).

Ha!

mikeytown2’s picture

FileSize
798 bytes

I can not repo this, so I will need your help. Lets try getting rid of stream_set_blocking(). This is the only thing that touches the stream before stream_select().

mikeytown2’s picture

FileSize
1.5 KB

Once you've ruled that out; we can try getting rid of the STREAM_CLIENT_ASYNC_CONNECT flag. This patch will do that.

mikeytown2’s picture

FileSize
1.58 KB

scratch #5, use this one AFTER testing #4

mikeytown2’s picture

FileSize
1.57 KB

I need a break...
scratch #5 & #6, use this one AFTER testing #4

Peter Bowey’s picture

#4 gave the same results!
Now trying #7

Peter Bowey’s picture

#7 Patch solved the issue!
That was tested with *all caches / storage* = NULL

Notes: I see that we have removed the option "_ASYNC_CONNECT"

Have the break Mike!
Many thanks for your time.

mikeytown2’s picture

FileSize
1.4 KB

I would like to use async connect if it is possible. Going to see if stream_get_meta_data() will do the trick for us. Mind testing this last patch for me?

Peter Bowey’s picture

Refer #10
@mikeytown2,
thanks Mike will test that *patch* within the next 1 hour!

Peter Bowey’s picture

Refer #10

Results:

Warning: stream_select(): 332 is not a valid stream resource in advagg_async_send_http_request() (line 2951 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
Warning: stream_select(): 332 is not a valid stream resource in advagg_async_send_http_request() (line 2951 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
Warning: stream_select() [<a href='function.stream-select'>function.stream-select</a>]: No stream arrays were passed in advagg_async_send_http_request() (line 2951 of /var/www/virtual/peterbowey.com.au/sites/all/modules/advagg/advagg.module).
mikeytown2’s picture

Component: Bundler » Code
Status: Needs review » Fixed
FileSize
1.28 KB

bummer that stream_get_meta_data doesn't fly. Thanks for testing!

I've committed this patch.

Peter Bowey’s picture

Refer #13
@mikeytown2, many thanks!
So 'sadly' we lose PHP's 'STREAM_CLIENT_ASYNC_CONNECT', so no 'non-blocking' mode..

mikeytown2’s picture

We still get async on writing to the connection, just not on establishing the connection. It's a very minor slowdown for what we're doing. Just wondering, what version of PHP are you using?

Peter Bowey’s picture

Refer #15

what version of PHP are you using?

php-fpm -v
PHP 5.3.6 (fpm-fcgi) (built: Jun 13 2011 20:02:15)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

Notes: PHP-FPM is unix:socket connected via Nginx 'upstream' pooling => server unix:/tmp/php-fastcgi.socket max_fails=2 fail_timeout=20s;

and PHP CLI:

php -v
PHP 5.3.6 with Suhosin-Patch (cli) (built: Jun 13 2011 20:01:03)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
mikeytown2’s picture

Hmmm I'm using 5.2.10. Sounds like they broke it; it's not a well used code path as it's kinda complicated to get working correctly.

Peter Bowey’s picture

Refer #17
'PHP 5.3.x 'broken' async_streams'
Yes that is likely, I did write a working routine for this *newer* version once, but it was harder than the doc's state.

mikeytown2’s picture

I've created a new issue to re-enable this as a feature request #1194820: Detect if STREAM_CLIENT_ASYNC_CONNECT doesn't work on server. Sounds like STREAM_CLIENT_ASYNC_CONNECT will work for me, but not for you. It's a shame, but that's how it goes sometimes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

alexx90’s picture

I'm having this problem using advagg module
warning: Invalid argument supplied for foreach() in /home/pa2230rd/mysite/sites/all/modules/advagg/advagg.module on line 2534.

mikeytown2’s picture

@alexx90
Thats a new issue, next time create a new issue for it. #1405360: warning: Invalid argument supplied for foreach()