#32861 [Com]: timeout is ignored in stream_select function
| From: | estoesunapija at hotmail dot com | Date: | Mon, 20 Oct 2008 20:02:58 +0000 |
| Subject: | #32861 [Com]: timeout is ignored in stream_select function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-129891@lists.php.net to get a copy of this message | ||
ID: 32861
Comment by: estoesunapija at hotmail dot com
Reported By: lew at mailduct dot com
Status: No Feedback
Bug Type: Filesystem function related
Operating System: FreeBSD 4.11-REL
PHP Version: 5.0.4, 4.3.10
Assigned To: pollita
New Comment:
Its been like a year since im waiting for this to be fixed!
Previous Comments:
------------------------------------------------------------------------
[2005-11-14 01:00:03] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-11-07 00:02:23] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-07-29 01:56:21] sniper@php.net
Assigning to Sara who knows this stuff..
------------------------------------------------------------------------
[2005-07-28 20:26:32] lew at mailduct dot com
After testing with the latest php5 release, this still has a problem.
Let me try to be more succinct in summarizing...
When operating with wrapper_type of 'plainfile' (such as when tailing
one or more files), the tv_sec and tv_usec (timeout) are ignored...
because stream_select insists on classifying FEOF as an important event.
While this may be true for a socket event (socket close, for example...
which is why we have socket_select instead), it is not true for a
plainfile event.
Ask yourself this question -- How would you make use of the 'timeout'
parameter when reading from a plainfile wrapper? It would never come
into play if FEOF awakens the stream_select call! The purpose of
stream_select is to let you multiplex streams... so you can WAIT for an
action to take place on a stream (or a timeout). If FEOF is allowed to
awaken the select (rather than waiting for a timeout or for data to
become available), then there's not much point to using that call...
You're forcing it to do [expensive] polling instead of relying on the
select() interrupt structure to do the work for you.
My second argument is this: Let's assume you insist FEOF should awaken
the select. If that's the case, then it still is not working
correctly... because if I *add data* to a file after the select detected
EOF, and then do a select again, it *still* thinks no data is available
(and that we're still at EOF even though we're not).
This is VERY broken.
------------------------------------------------------------------------
[2005-05-27 00:04:54] lew at mailduct dot com
I have now tested this using both PHP 4.3.11 and 5.0.4, and the bug
remains. My same prior notes apply. Please review.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/32861
--
Edit this bug report at http://bugs.php.net/?id=32861&edit=1