php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53380 fgets() hangs on repetitive connection to same url
Submitted: 2010-11-22 19:39 UTC Modified: 2013-02-18 00:34 UTC
From: kontakt at beberlei dot de Assigned:
Status: No Feedback Package: Sockets related
PHP Version: 5.3.3 OS: Ubuntu 10.10
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 + 35 = ?
Subscribe to this entry?

 
 [2010-11-22 19:39 UTC] kontakt at beberlei dot de
Description:
------------
I stumbled into this bug where fgets() hangs on me as long as the connection timeout with a http socket resource (CouchDB webserver).

The reproduce code is a bit longish as i think it has to do with the fetching of the same url twice. It makes no difference though if i use Keep Alive or close Connections after usage.

Code: http://pastie.org/1317962
Xdebug Output: http://pastie.org/1317997

Strace output is attached.


Patches

socketproblem.strace (last revision 2010-11-22 18:41 UTC by kontakt at beberlei dot de)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-23 04:39 UTC] cataphract@php.net
-Status: Open +Status: Feedback
 [2010-11-23 04:39 UTC] cataphract@php.net
I can't find anything wrong here.

The request is apparently successfully written (fwrite in PHP and the send() syscall return immediately, indicating it was put in the send buffer of the socket).

Then, the script calls fgets, which tries to read from the socket. However, this operation times out. Likely, the server was not able to respond in such a short period of time (1 second). I suggest you increase the timeout and try again.
 [2013-02-18 00:34 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 "Open". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed May 18 17:05:45 2022 UTC