mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
b7527f6b72
Added an option to yassl to allow "quiet shutdown" like openssl does. This option causes the SSL libs to NOT perform the close_notify handshake during shutdown. This fixes a hang we experience because we hold a lock during socket shutdown. mysql-test/t/ssl_big.test: BitKeeper file /Users/dkatz/50/mysql-test/t/ssl_big.test mysql-test/r/ssl-big.result: BitKeeper file /Users/dkatz/50/mysql-test/r/ssl-big.result client/mysqltest.c: Added new command to mysqltest to send a quit command to the server, but to not close the actual socket on our end. Also changed code to reuse connection slots, so that the tests can open and close sockets in a loop. extra/yassl/include/openssl/ssl.h: Added C accessors to the quietShutdown option. extra/yassl/include/yassl_int.hpp: Added quietShutdown_ member and accessor methods to the SSL class. extra/yassl/src/ssl.cpp: Added accessors to get/set the quietShutdown option and to not perform the shutdown handshake if quietShutdown is set. extra/yassl/src/yassl_int.cpp: Added quietShutdown_ member and accessor methods to the SSL class. vio/viossl.c: Added line to set the quiet_shutdown option before shutting down the socket. mysql-test/t/ssl-big.test: Added a test that causes an unpatched server to hang during SSL socket shutdown.
56 lines
1.2 KiB
Text
56 lines
1.2 KiB
Text
# Turn on ssl between the client and server
|
|
# and run a number of tests
|
|
|
|
-- source include/have_ssl.inc
|
|
-- source include/big_test.inc
|
|
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
--enable_warnings
|
|
|
|
#
|
|
# Bug #29579 Clients using SSL can hang the server
|
|
#
|
|
|
|
connect (ssl_con,localhost,root,,,,,SSL);
|
|
|
|
create table t1 (a int);
|
|
|
|
disconnect ssl_con;
|
|
|
|
|
|
--disable_query_log
|
|
--disable_result_log
|
|
|
|
let $count= 2000;
|
|
while ($count)
|
|
{
|
|
connect (ssl_con,localhost,root,,,,,SSL);
|
|
|
|
eval insert into t1 values ($count);
|
|
dec $count;
|
|
|
|
# This select causes the net buffer to fill as the server sends the results
|
|
# but the client doesn't reap the results. The results are larger each time
|
|
# through the loop, so that eventually the buffer is completely full
|
|
# at the exact moment the server attempts to the close the connection with
|
|
# the lock held.
|
|
send select * from t1;
|
|
|
|
# now send the quit the command so the server will initiate the shutdown.
|
|
send_quit ssl_con;
|
|
|
|
# if the server is hung, this will hang too:
|
|
connect (ssl_con2,localhost,root,,,,,SSL);
|
|
|
|
# no hang if we get here, close and retry
|
|
disconnect ssl_con2;
|
|
disconnect ssl_con;
|
|
}
|
|
--enable_query_log
|
|
--enable_result_log
|
|
|
|
connect (ssl_con,localhost,root,,,,,SSL);
|
|
|
|
drop table t1;
|
|
|