Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL)
-
None
-
YASSL, threadpool
-
5.5.49
Description
Client that is connected with SSL, that stays idle for a while, will be disconnected.
To reproduce
- start the server with ssl, e.g
perl mysql-test-run.pl ssl --start
- connect with ssl client, e.g
mysql -uroot --port=16000 --ssl
- issue a command, e.g SELECT 1
- wait 1 minute
- repeat SELECT 1
- see
ERROR 2013 (HY000): Lost connection to MySQL server during query
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
Client that is connected with SSL, that stays idle for a while, will be disconnected.
To reproduce * start the server with ssl, e.g {{ perl mysql-test-run.pl ssl --start }} * connect with ssl client, e.g {{mysql -uroot --port=16000 --ssl}} * issue a command, e.g SELECT 1 * wait 1 minute * repeat SELECT 1 {{ ERROR 2013 (HY000): Lost connection to MySQL server during query }} |
Client that is connected with SSL, that stays idle for a while, will be disconnected.
To reproduce * start the server with ssl, e.g {{ perl mysql-test-run.pl ssl --start }} * connect with ssl client, e.g {{ mysql -uroot --port=16000 --ssl }} * issue a command, e.g SELECT 1 * wait 1 minute * repeat SELECT 1 {{ ERROR 2013 (HY000): Lost connection to MySQL server during query }} |
Description |
Client that is connected with SSL, that stays idle for a while, will be disconnected.
To reproduce * start the server with ssl, e.g {{ perl mysql-test-run.pl ssl --start }} * connect with ssl client, e.g {{ mysql -uroot --port=16000 --ssl }} * issue a command, e.g SELECT 1 * wait 1 minute * repeat SELECT 1 {{ ERROR 2013 (HY000): Lost connection to MySQL server during query }} |
Client that is connected with SSL, that stays idle for a while, will be disconnected.
To reproduce * start the server with ssl, e.g perl mysql-test-run.pl ssl --start * connect with ssl client, e.g mysql -uroot --port=16000 --ssl * issue a command, e.g SELECT 1 * wait 1 minute * repeat SELECT 1 *see ERROR 2013 (HY000): Lost connection to MySQL server during query |
Description |
Client that is connected with SSL, that stays idle for a while, will be disconnected.
To reproduce * start the server with ssl, e.g perl mysql-test-run.pl ssl --start * connect with ssl client, e.g mysql -uroot --port=16000 --ssl * issue a command, e.g SELECT 1 * wait 1 minute * repeat SELECT 1 *see ERROR 2013 (HY000): Lost connection to MySQL server during query |
Client that is connected with SSL, that stays idle for a while, will be disconnected.
To reproduce * start the server with ssl, e.g {code}perl mysql-test-run.pl ssl --start{code} * connect with ssl client, e.g {code}mysql -uroot --port=16000 --ssl{code} * issue a command, e.g {{SELECT 1}} * wait 1 minute * repeat {{SELECT 1}} * see {noformat}ERROR 2013 (HY000): Lost connection to MySQL server during query{noformat} |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Affects Version/s | 5.5 [ 15800 ] | |
Affects Version/s | 10.0 [ 16000 ] | |
Affects Version/s | 10.1 [ 16100 ] |
Fix Version/s | 5.5 [ 15800 ] | |
Fix Version/s | 10.0 [ 16000 ] | |
Fix Version/s | 10.1 [ 16100 ] |
Assignee | Vladislav Vaintroub [ wlad ] |
Assignee | Vladislav Vaintroub [ wlad ] | Sergei Golubchik [ serg ] |
Status | Confirmed [ 10101 ] | In Review [ 10002 ] |
Sprint | 5.5.49-1 [ 48 ] |
Assignee | Sergei Golubchik [ serg ] | Vladislav Vaintroub [ wlad ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Vladislav Vaintroub [ wlad ] | Sergei Golubchik [ serg ] |
Fix Version/s | 5.5.49 [ 21600 ] | |
Fix Version/s | 10.0.25 [ 21701 ] | |
Fix Version/s | 10.1.14 [ 21804 ] | |
Fix Version/s | 5.5 [ 15800 ] | |
Fix Version/s | 10.0 [ 16000 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 74710 ] | MariaDB v4 [ 150279 ] |
The actual reason why the connection is lost seems to be a bug in yassl's implementation of SSL_pending(), which is called inside vio_ssl_has_data().
The socket is doing blocking recv() inside this function, and runs into net_read_timeout after a while. After that, connection breaks.
Doing blocking reads inside vio_ssl_has_data (or SSL_pending) does not sound like a great idea.
Below is the callstack of the blocking recv() calls
>Debug.ListCallStack /T:No /ShowByteOffset:No /ShowValues:No /ShowExternalCode:Yes
Index Function
--------------------------------------------------------------------------------
1 ntdll.dll!_ZwWaitForSingleObject@12()
2 mswsock.dll!_SockWaitForSingleObject@16()
3 mswsock.dll!_WSPRecv@36()
4 ws2_32.dll!_recv@16()
*5 mysqld.exe!yaSSL::Socket::wait()
6 mysqld.exe!yaSSL::DoProcessReply(ssl)
7 mysqld.exe!yaSSL::processReply(ssl)
8 mysqld.exe!yaSSL::receiveData(ssl, data, peek)
9 mysqld.exe!yaSSL_peek(ssl, buffer, sz)
10 mysqld.exe!yaSSL_pending(ssl)
11 mysqld.exe!vio_ssl_has_data(vio)
12 mysqld.exe!threadpool_process_request(thd)
13 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)
---------------------------------------------------------------------------------
1 mysqld.exe!vio_read(vio, buf, size)
2 mysqld.exe!yassl_recv(ptr, buf, len, flag)
3 mysqld.exe!yaSSL::Socket::receive(buf, sz, flags)
4 mysqld.exe!yaSSL::DoProcessReply(ssl)
5 mysqld.exe!yaSSL::processReply(ssl)
6 mysqld.exe!yaSSL::receiveData(ssl, data, peek)
7 mysqld.exe!yaSSL_peek(ssl, buffer, sz)
8 mysqld.exe!yaSSL_pending(ssl)
9 mysqld.exe!vio_ssl_has_data(vio)
10 mysqld.exe!threadpool_process_request(thd)
11 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)