From:             vesely at tana dot it
Operating system: Unix
PHP version:      4.4.0
PHP Bug Type:     Feature/Change Request
Bug description:  Alarm needed for proc_open pipes

Description:
------------
When using the Apache module it is not possible
to use pcntl_alarm (why?). OTOH stream_set_timeout
does not work on the "pipe" in descriptorspec.

Of course, if the program really doesn't know _if_
there is any data to read, it should use stream_select
and fgetc in a loop. Frequently enough, the program
knows what it is doing and wants to sleep on fgets
until data is available on the pipe. If anything goes
wrong here, the two processes may hang waiting for
each other. Meanwhile, the user angrily reloads the
page knocking out yet another Apache's child...

"NEEDED: a timeout for stdout pipe, otherwise a fgets on
$pipes[1] can lag forever...)" has been for years in
http://www.php.net/manual/en/function.proc-open.php#20866

The global script timeout is quite hard to manage from
an included function. stream_select and fgets is good
but is not bullet-proof. A request for a timer already
exists (bug #9676), hence I guess I should ask for some
"guarded-pipe" where the select-fgetc loop is coded in C
using a time limit that can be set via stream_set_timeout.
Is that cool?


-- 
Edit bug report at http://bugs.php.net/?id=33781&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33781&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33781&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33781&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33781&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33781&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33781&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33781&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33781&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33781&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33781&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33781&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33781&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33781&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33781&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33781&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33781&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33781&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33781&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33781&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33781&r=mysqlcfg

Reply via email to