#49965 [Opn->Fbk]: Setting MYSQLI_OPT_CONNECT_TIMEOUT does not seem to have an effect on timeout
| From: | uw@php.net | Date: | Tue, 27 Oct 2009 10:04:54 +0000 |
| Subject: | #49965 [Opn->Fbk]: Setting MYSQLI_OPT_CONNECT_TIMEOUT does not seem to have an effect on timeout | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143999@lists.php.net to get a copy of this message | ||
ID: 49965
Updated by: uw@php.net
Reported By: ed at bellcpa dot com
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: Windows Server 2008
PHP Version: 5.3.0
New Comment:
60s - we are back to some config problem. Can you try change the
default_socket_timeout? Can you try a 5.3.1 snapshot?
Thanks!
Ulf
Previous Comments:
------------------------------------------------------------------------
[2009-10-26 21:10:09] ed at bellcpa dot com
After further testing:
The php_errors.log messages previously mentioned are logged exactly 60
sec after a connection attempt is made so some timeout is likely in
effect. Also, the script remains running in a "hung" state after the
errors are logged.
Post connection timeout is not a concern here, instead the issue is
with the length of the timeout when MySQL server is purposely not
online.
I have Wireshark captures for when the MySQL server is offline and
connection times out as well as when MySQL is online and connection
succeeds right away. Can I email these to you?
I am using mysqli on 5.3.0 with default settings, shouldn't mysqlnd be
used by default?
I will try a snapshot soon once I find the time to test.
Thanks!
------------------------------------------------------------------------
[2009-10-23 19:24:29] uw@php.net
PS: don't rely on connect timeout of libmysql - it does not work in
every case. Check bugs.mysql.com.
------------------------------------------------------------------------
[2009-10-23 19:22:04] uw@php.net
Can you give more details? I'm unable to reproduce the issue with
5.3.2-dev (= should become 5.3.1). Is it possible for you to try a
snapshot? Can you provide me with a Wireshark (network sniffer)
protocol?
The connect timeout itself should work. If not, it should be a streams
or Windows matter. First question is what exactly "connect timeout"
means. A wireshark protocol should be able to tell. In 5.3.0 you may get
a successful connect within the time limit you set but then, when
reading data, experience default_socket_timeout.
Thanks!
------------------------------------------------------------------------
[2009-10-23 18:37:11] ed at bellcpa dot com
Worked around the problem for now by testing the connection with
fsockopen prior to real_connect.
------------------------------------------------------------------------
[2009-10-23 17:13:43] ed at bellcpa dot com
Oh but I did search and have seen #49511 propr to submitting....
#49511 mainly focuses on a query timeout and not a connection timeout,
which is my issue. MYSQL_OPT_CONNECT_TIMEOUT mentioned is unaddressed.
Also tried ini_set('default_socket_timeout', 5) as suggested in that
submission with no effect.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49965
--
Edit this bug report at http://bugs.php.net/?id=49965&edit=1