mariadb/mysql-test/t/im_daemon_life_cycle.imtest
unknown 48ed060dd0 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.
2006-09-01 18:20:33 +04:00

60 lines
1.7 KiB
Text

###########################################################################
#
# This file contains test for (1.2) test suite.
#
# Consult WL#2789 for more information.
#
###########################################################################
--source include/im_check_env.inc
###########################################################################
# Kill the IM main process and check that the IM Angel will restart the main
# 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