|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-06-19 08:25 UTC] imsiren at 163 dot com
-Summary: fpm slow log && fsockopen :Operation now in
progress
+Summary: fpm slow log && fsockopen :Operation now in progress
[2014-06-19 08:25 UTC] imsiren at 163 dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 18:00:01 2025 UTC |
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"