php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47477 [PATCH] php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load
Submitted: 2009-02-23 09:40 UTC Modified: 2009-02-23 15:58 UTC
From: g dot bonacci at libero dot it Assigned:
Status: Closed Package: cURL related
PHP Version: 5.*CVS, 6CVS (2009-02-23) 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: g dot bonacci at libero dot it
New email:
PHP Version: OS:

 

 [2009-02-23 09:40 UTC] g dot bonacci at libero dot it
Description:
------------
php_curl_stream_read() in ext/curl/streams.c always calls select() after firing up a connection.  

however, when the php client is under heavy load, the server might have already responded, and the last call to curl_multi_perform() before entering the loop might have received all the data and closed the connection.  

at this point, curl_multi_fdset() in the loop returns maxfs == -1, and the following select turns into a pointless 15 sec sleep. 

please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514832
for reference.

a patch is available at
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=php.curlstream.patch;att=1;bug=514832


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-23 15:58 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2009-07-25 13:09 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=284748
Log: - Merge from PHP_5_3:
r280810 | kalle: Fixed compiler warnings
r276286 | iliaa: Fixed bug #47477 (php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jan 18 05:01:29 2025 UTC