php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58396 Enabling pipelining on a pool which one request returns a 404 hangs Apache2
Submitted: 2008-10-28 11:48 UTC Modified: 2009-02-11 11:22 UTC
From: Jared dot Williams1 at ntlworld dot com Assigned: mike (profile)
Status: No Feedback Package: pecl_http (PECL)
PHP Version: 5_2 CVS-2008-10-28 (dev) OS: Windows 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Jared dot Williams1 at ntlworld dot com
New email:
PHP Version: OS:

 

 [2008-10-28 11:48 UTC] Jared dot Williams1 at ntlworld dot com
Description:
------------
There may be a problem with enabling pipelining on a request 
pool, when one of the requests returns a 404. 

It seems to completely lock up Apache2.0 (Win32), and only a 
restart seems to free it.

Not enabling pipelining works fine.





Reproduce code:
---------------
$pool = new HttpRequestPool();
$pool->enablePipelining(true);
$requests = array();
foreach($urls as $url)
{
	$r = new HttpRequest($url);

	$r->addHeaders($headers);
	if (isset($request['Cookie']) && $request['Cookie'])
		$r->addCookies($request['Cookie']);

	$requests[$url] = $r;
	$pool->attach($r);
}

$pool->send();



Expected result:
----------------
Apache not to hang.

Actual result:
--------------
Some requests are returned, as seen by watching via a 
debugging reverse proxy (Fiddler2). But the 404 url and any 
other uncompleted requests don't appear to happen.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-29 03:24 UTC] mike@php.net
What's your pecl_http and libcurl version (excerpt of phpinfo)? 

...and please provide complete reproduce scripts.
 [2008-10-29 08:23 UTC] Jared dot Williams1 at ntlworld dot com
curl: libcurl/7.16.0 OpenSSL/0.9.8i zlib/1.2.3
pecl_http: 1.6.1-dev

Both the latest compiled versions I can find for Windows. 

Complete scripts to reproduce looks like its going to take some time. Reduced 
my code to the relevant bits, and now pecl/http is throwing HttpInvalidParamExceptions.

No idea what its complaining about.

<b>Fatal error</b>:  Uncaught exception 'HttpRequestPoolException' with message 
'Exception caused by 4 inner exception(s)' in 
E:\xampplite\htdocs\proxy\bug.php:43
 inner exception 'HttpInvalidParamException' with message 'Empty or too short 
HTTP message: ''' in E:\xampplite\htdocs\proxy\bug.php:43
 inner exception 'HttpRequestException' with message 'failed sending data to 
the peer; Send failure: Connection was aborted 
(http://localhost:8888/proxy/test/header.htm)' in 
E:\xampplite\htdocs\proxy\bug.php:43
 inner exception 'HttpInvalidParamException' with message 'Empty or too short 
HTTP message: ''' in E:\xampplite\htdocs\proxy\bug.php:43
 inner exception 'HttpRequestException' with message 'failed sending data to 
the peer; Send failure: Connection was aborted 
(http://localhost:8888/proxy/test/missing.htm)' in 
E:\xampplite\htdocs\proxy\bug.php:27
Stack trace:
#0 E:\xampplite\htdocs\proxy\bug.php(43): HttpRequestPool-&gt;send()
#1 E:\xampplite\htdocs\proxy\bug.php(68): PeclHttpFragmentProvider-&gt;get()
#2 {main}
  thrown in <b>E:\xampplite\htdocs\proxy\bug.php</b> on line <b>43</b><br />

Even though Apache2, as viewed from Fiddler2 is serving the content fine.
 [2008-11-21 05:17 UTC] mike@php.net
Please provide a complete reproduce script and it would help a lot if you could give me an endpoint (maybe privately) to test myself.
 [2009-02-11 11:22 UTC] mike@php.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 "Open". Thank you.


 [2010-09-02 14:13 UTC] from dot php dot net at brainbox dot cz
I experienced the error "Empty or too short HTTP message" as well. However then I found the workaround: Just call 

http_persistent_handles_clean()

before each sent HttpRequest. This solution has minimized the amount of errors to minimum for me (Win32, PHP 5.3).
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Nov 12 23:01:34 2019 UTC