Bug #36994 Mysqld on vista cannot detect disconnection a network immediately.
Submitted: 27 May 2008 3:46 Modified: 2 Jan 2017 11:15
Reporter: Meiji KIMURA Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.0.51a OS:Windows (Vista)
Assigned to: CPU Architecture:Any

[27 May 2008 3:46] Meiji KIMURA
Description:
I use MySQL(mysqld) on Windos Vista.
I made a connection from another machine to it, then mysqladmin reported 'Threads: 2'.

C:\xampp\mysql\bin>mysqladmin status -uroot
Uptime: 6035  Threads: 2  Questions: 22  Slow queries: 0  Opens: 12  Flush table
s: 1  Open tables: 0  Queries per second avg: 0.004

Then I disconnected Vista machine from network, and re-run mysqladmin.
It reported the same 'Threads: 2' like this,

C:\xampp\mysql\bin>mysqladmin status -uroot
Uptime: 7857  Threads: 2  Questions: 32  Slow queries: 0  Opens: 12  Flush table
s: 1  Open tables: 0  Queries per second avg: 0.004

Appox 2-hour later, mysqld can detect a disconnection like this,
C:\xampp\mysql\bin>mysqladmin status -uroot
Uptime: 9080  Threads: 1  Questions: 33  Slow queries: 0  Opens: 12  Flush table
s: 1  Open tables: 0  Queries per second avg: 0.004

If I use not Vista but WinXP, it can detect in few seconds under the same environment.

How to repeat:
(1) Connect to MySQL(mysqld) on Windows Vista.
(2) Run 'mysqladmin status' for checking 'Threads:'.

C:\xampp\mysql\bin>mysqladmin status -uroot
Uptime: 6035  Threads: 2  Questions: 22  Slow queries: 0  Opens: 12  Flush table
s: 1  Open tables: 0  Queries per second avg: 0.004

(3) Unplug the LAN cable to disconnect from network.
(3) Re-run 'mysqladmin status' for checking 'Threads:'.

Suggested fix:
I'm not sure, but it may be caused by behavior of Vista's WinSock(TCP/IP).
[27 May 2008 4:45] Meiji KIMURA
In this situation, processlist like this,

C:\xampp\mysql\bin>mysqladmin processlist -uroot
+----+--------+-------------------+----+---------+------+-------+------------------+
| Id | User   | Host              | db | Command | Time | State | Info   |
+----+--------+-------------------+----+---------+------+-------+------------------+
| 32 | kimura | 192.168.1.16:1082 |    | Sleep   | 40   |       |   |
| 41 | root   | localhost:51610   |    | Query   | 0    |       | show processlist |
+----+--------+-------------------+----+---------+------+-------+------------------+

'kimura' is a client. It is connected from another machine(192.168.1.16). It not disappear after the disconnection. 'Time' increases until detecting the disconnection.

I suspected that Vista's TCP behavior has changed, I use Putty to connect/disconnect under the same Vista environment, but it can detecte a disconnection in few seconds.
[27 May 2008 12:23] Peter Laursen
I reported this one:
http://bugs.mysql.com/bug.php?id=31109

but after some Vista updates (I guess) this problem went away.
[27 May 2008 12:30] Peter Laursen
but now I checked again and my problem is back again!
[28 May 2008 7:01] Meiji KIMURA
Hi peter,

I saw your bug report,
http://bugs.mysql.com/bug.php?id=31109

Your report is about client side, my report is about server side.
But it may be the same cause.
[2 Jan 2017 11:16] Erlend Dahl
Neither 5.0 nor Vista are supported any more.