Bug #11592 Updated: need for an a SIGALRM based timeout mecanism
| From: | rasmus@php.net | Date: | Thu, 21 Jun 2001 03:14:58 +0000 |
| Subject: | Bug #11592 Updated: need for an a SIGALRM based timeout mecanism | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57503@lists.php.net to get a copy of this message | ||
ID: 11592
Updated by: rasmus
Reported By: thomas.morin@webmotion.com
Old-Status: Open
Status: Analyzed
Bug Type: Feature/Change Request
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
The problem is that at least with Apache we cannot use
SIGALRM as Apache has taken that. When PHP is running as
an embedded module in a web server, messing with the signals
is usally a no-no. If you can come up with some way of
doing this cleanly without signals, please speak up.
And by the way, fsockopen() has a timeout parameter.
Previous Comments:
---------------------------------------------------------------------------
[2001-06-20 17:12:15] thomas.morin@webmotion.com
As mentionned in #9676, in #8595 and in comments in the set_time_limit function online manual page,
set_time_limit seems to be not suitable to solve some problems like :
- fopen on a url for which the distant server is not responding
- exec an external program which hangs
- trying to resolve some DNS name
- sleep()
- etc.
The "better" solution I've read was a suggestion to use SOAP or XML-RPC to wrap such
requests... this would be like using a hammer to kill a fly... :)
It would be _great_ to have a mecanism (based on an alarm signal or similar for instance) to be able
to define a timeout on all low-level functions (or at least some of them like fopen, fsockopen,
exec, gethostby...).
Such a missing feature can be a show stopper one for people needing to retrieve data from an
(unreliable?) external datafeed for instance.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11592&edit=2