Bug #67471 [Opn]: fpm slow log && fsockopen :Operation now in progress
| From: | imsiren at 163 dot com | Date: | Thu, 19 Jun 2014 08:25:18 +0000 |
| Subject: | Bug #67471 [Opn]: fpm slow log && fsockopen :Operation now in progress | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186248@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67471&edit=1
ID: 67471
User updated by: imsiren at 163 dot com
Reported by: imsiren at 163 dot com
-Summary: fpm slow log && fsockopen ï¼Operation now in
progress
+Summary: fpm slow log && fsockopen :Operation now in progress
Status: Open
Type: Bug
Package: FPM related
Operating System: Centos 5.5
PHP Version: 5.4.29
Block user comment: N
Private report: N
New Comment:
modify summary.
Previous Comments:
------------------------------------------------------------------------
[2014-06-19 07:56:19] imsiren at 163 dot com
Description:
------------
Hello :
There is a err in my script, When fpm open slowlog,the "request_slowlog_timeout " sets
3 seconds,"request_terminate_timeout" is 10 seconds, I try to connect a web url use
fsockopen,if the web url can not arrived because of some error, the fsockopen will return
"Operation now in progress",I know ,that mean is the socket trying to connect that web
url in non-block,although return,but in connection.
If used php client execute the same script,that will be return "Connect Time out",so the
problem only in fpm.
I try to read fpm source code, find the reasonï¼
fpm has a master progress to manage child progresses,fsockopen open a error url(or can not
arrived ),the progress will be block in connect until connect time out,php script running slowly
that will be trigger master progress write slow log,in this time, master progress will send SIGSTOP
signal to child progress that will be stop the child progress,then master progress write slow log
or trace info, this done, master progress will send SIGCONT signal to the stoped child progress,then
child progress will be continue running, in this time, child progress should be block in connect,
but ,in fact not this,connect will return immediately,then call error() will return 'Operation
now in progress'.
sorry ,I dont know whether you can understand me, is this a bug or error?
Test script:
---------------
<?php
$url="1.2.3.2";
$fp = fsockopen($url, 9890, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: $url\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
Expected result:
----------------
fsockopen should be return "connect time out", not "Operation now in progress".
Actual result:
--------------
fsockopen return "Operation now in progress"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67471&edit=1