mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BUG#12751: Instance Manager: client hangs after
start instance; kill mysqlmanager; show ... The problem was that Instance Manager didn't close client sockets (sockets for client connections) on execing mysqld instance. So, mysqld-instance inherits these descriptors. The fix is to set close-on-exec flag for each client socket. mysql-test/r/im_daemon_life_cycle.result: Updated result file. mysql-test/t/im_daemon_life_cycle.imtest: Test for BUG#12751. server-tools/instance-manager/listener.cc: Set close-on-exec flag for each client socket.
This commit is contained in:
@ -8,3 +8,17 @@ mysqld2 offline
|
||||
Killing the process...
|
||||
Sleeping...
|
||||
Success: the process was restarted.
|
||||
|
||||
--------------------------------------------------------------------
|
||||
-- Test for BUG#12751
|
||||
--------------------------------------------------------------------
|
||||
START INSTANCE mysqld2;
|
||||
Success: the process has been started.
|
||||
Killing the process...
|
||||
Sleeping...
|
||||
Success: the process was restarted.
|
||||
SHOW INSTANCE STATUS mysqld1;
|
||||
instance_name status version
|
||||
mysqld1 online VERSION
|
||||
STOP INSTANCE mysqld2;
|
||||
Success: the process has been stopped.
|
||||
|
@ -14,3 +14,47 @@
|
||||
# process.
|
||||
|
||||
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 30
|
||||
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# BUG#12751: Instance Manager: client hangs
|
||||
#
|
||||
|
||||
--echo
|
||||
--echo --------------------------------------------------------------------
|
||||
--echo -- Test for BUG#12751
|
||||
--echo --------------------------------------------------------------------
|
||||
|
||||
# Give some time to begin accepting connections after restart.
|
||||
# FIXME: race condition here.
|
||||
|
||||
--sleep 3
|
||||
|
||||
# 1. Start mysqld;
|
||||
|
||||
START INSTANCE mysqld2;
|
||||
# FIXME: START INSTANCE should be synchronous.
|
||||
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started
|
||||
|
||||
# 2. Restart IM-main: kill it and IM-angel will restart it.
|
||||
|
||||
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 30
|
||||
|
||||
# 3. Issue some statement -- connection should be re-established.
|
||||
|
||||
# Give some time to begin accepting connections after restart.
|
||||
# FIXME: race condition here.
|
||||
|
||||
--sleep 3
|
||||
|
||||
--replace_column 3 VERSION
|
||||
SHOW INSTANCE STATUS mysqld1;
|
||||
|
||||
# 4. Stop mysqld2, because it will not be stopped by IM, as it is nonguarded.
|
||||
# So, if it we do not stop it, it will be stopped by mysql-test-run.pl with
|
||||
# warning.
|
||||
|
||||
STOP INSTANCE mysqld2;
|
||||
# FIXME: STOP INSTANCE should be synchronous.
|
||||
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped
|
||||
|
Reference in New Issue
Block a user