php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11592 need for an a SIGALRM based timeout mecanism
Submitted: 2001-06-20 17:12 UTC Modified: 2017-01-29 04:22 UTC
Votes:40
Avg. Score:3.3 ± 1.1
Reproduced:13 of 17 (76.5%)
Same Version:8 (61.5%)
Same OS:9 (69.2%)
From: thomas dot morin at webmotion dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: * OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: thomas dot morin at webmotion dot com
New email:
PHP Version: OS:

 

 [2001-06-20 17:12 UTC] thomas dot morin at webmotion dot 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.




Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-20 23:14 UTC] rasmus@php.net
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.
 [2010-11-24 09:02 UTC] jani@php.net
-Package: Feature/Change Request +Package: *General Issues -Operating System: irrelevant +Operating System: * -PHP Version: 4.0.5 +PHP Version: *
 [2017-01-20 17:05 UTC] heiglandreas@php.net
-Status: Analyzed +Status: Feedback
 [2017-01-20 17:05 UTC] heiglandreas@php.net
Is this still relevant?
 [2017-01-29 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 03:01:27 2024 UTC