|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57193 HttpRequestPool suppresses exceptions
Submitted: 2006-08-22 11:01 UTC Modified: 2007-02-20 04:42 UTC
From: edoardo dot serra at webrainstorm dot it Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.1.4 OS: Linux 2.6.11-1.1369_FC4smp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
32 + 39 = ?
Subscribe to this entry?

 [2006-08-22 11:01 UTC] edoardo dot serra at webrainstorm dot it
Hi guys,
I'm using pecl_http 1.2.0 with curl enbabled (v7.13.1) and libz enabled (v1.2.2.2)

I'm testing HttpRequestPool with different numbers of requests.

When I use it to do 1000 or more requests it executes only a small amount of requests without giving exceptions of any kind.

That small amount of request is varying from time to time.
With the code below (1000 expected requests) I got a number of executed requests varying from 200 to 300.
(I got the number of executed requests grepping in the webserver logfile double checking with the script output)

I'm executing the script from the CLI

Reproduce code:
#!/usr/local/bin/php -q


/* utilize onfinish callback */
class Request extends HttpRequest {
    function onFinish($success) {
        printf("- %s -> %3d \n", $this->getUrl(), $this->getResponseCode());

$o = array("connecttimeout" => 10, "redirect" => 10);

for ($i = 1; $i <= 1000; $i++)
        $u[] = "".$i;

foreach ($u as $url) {
    $r[] = new Request($url, HTTP_METH_GET, $o);

printf ("Should do %d requests\n", count($r));

/* run requests in a pool */
$p = new HttpRequestPool;
foreach ($r as $request) {

try {
} catch (HttpRequestPoolException $ex) {
    foreach ($ex->exceptionStack as $e) {
        echo $e, "\n";

Expected result:
1000 lines indicating executed requests

Actual result:
200-300 lines indicating executed requests


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-23 09:44 UTC]
I'd appreciate if you could try current CVS version.

The exception was suppressed and it should be fixed in CVS.
You were hitting the timeout.  Please note that there's no exceptionStack property anymore, use something like the following instead:

do {
  echo $ex, "\n";
while ($ex = @$ex->innerException);

 [2006-08-24 07:42 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Mar 23 21:03:37 2023 UTC