Description:
Running sysbench tests on Windows 2003 Server with number of threads > 50-55 I got following error during establishing of connections:
FATAL: error 2013: Lost connection to MySQL server at 'reading initial communication packet', system error: 0
After looking at debug traces we found out that on Windows we are reporting wrong system error. Raw patch below fix this and now we get back correct error number.
FATAL: error 2013: Lost connection to MySQL server at 'reading initial communication packet', system error: 10054
However reason of such error is still unclear is under investigation.
=== modified file 'sql-common/client.c'
--- sql-common/client.c 2008-03-29 08:02:54 +0000
+++ sql-common/client.c 2008-11-17 12:34:26 +0000
@@ -2111,7 +2111,7 @@
set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
ER(CR_SERVER_LOST_EXTENDED),
"waiting for initial communication packet",
- errno);
+ socket_errno);
goto error;
}
@@ -2125,7 +2125,7 @@
set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
ER(CR_SERVER_LOST_EXTENDED),
"reading initial communication packet",
- errno);
+ socket_errno);
goto error;
}
/* Check if version of protocol matches current one */
How to repeat:
1. Download svn version of sysbench: svn co https://sysbench.svn.sourceforge.net/svnroot/sysbench/
2. Follow steps in README-WIN.txt to build the sysbench.exe binary.
3. Save the following test file as test.lua:
--- cut ---
function event(thread_id)
db_connect()
print ("Thread id - " .. thread_id)
db_disconnect()
return 1
end
--- cut ---
4. sysbench.exe --num-threads=<50-100> --test=test.lua --mysql-host=127.0.0.1 --mysql-user=root --mysql-port=3306 --max-requests=0 --max-time=1 --oltp-table-name=test --mysql-db=test run