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
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: kontakt at beberlei dot de
New email:
PHP Version: OS:

 

 [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)

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC