-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1447 from laurynas-biveinis/bug1537554-5.7
Bug1537554 5.7
- Loading branch information
Showing
8 changed files
with
132 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# | ||
# Test the effect of various signals on the server | ||
# | ||
--let $test_error_log= $MYSQLTEST_VARDIR/tmp/test_threadpool_sig_handler.err | ||
--let $restart_parameters=restart:--log-error=$test_error_log | ||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
--source include/restart_mysqld.inc | ||
|
||
SELECT @@GLOBAL.thread_handling; | ||
|
||
--let $mysqld_pid_file=`SELECT @@GLOBAL.pid_file` | ||
|
||
--echo # Test SIGPIPE, SIGTSTP, SIGINT, which should be ignored | ||
exec kill -PIPE `cat $mysqld_pid_file`; | ||
exec kill -TSTP `cat $mysqld_pid_file`; | ||
exec kill -INT `cat $mysqld_pid_file`; | ||
|
||
--echo # Test SIGHUP, which should result in status dump in the error log | ||
exec kill -HUP `cat $mysqld_pid_file`; | ||
|
||
SELECT 1; | ||
|
||
--echo # | ||
--echo # Bug 805805: attaching to percona-server with gdb disconnects clients | ||
--echo # Bug 1060136: safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT | ||
--echo # | ||
|
||
exec kill -STOP `cat $mysqld_pid_file`; | ||
exec kill -CONT `cat $mysqld_pid_file`; | ||
|
||
SELECT 1; | ||
|
||
--echo # | ||
--echo # Bug 1537554: SIGTERM kills server instead of shutdown w/ threadpool | ||
--echo # | ||
|
||
--source include/expect_crash.inc | ||
exec kill -TERM `cat $mysqld_pid_file`; | ||
--source include/wait_until_disconnected.inc | ||
|
||
--let $restart_parameters= | ||
--source include/start_mysqld.inc | ||
|
||
# Test for SIGHUP output | ||
--let SEARCH_FILE=$test_error_log | ||
--let SEARCH_PATTERN=Status information: | ||
--source include/search_pattern_in_file.inc | ||
|
||
# Test for SIGTERM output | ||
--let SEARCH_PATTERN=mysqld.*: Shutdown complete | ||
--source include/search_pattern_in_file.inc | ||
|
||
--remove_file $test_error_log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
SELECT 2+2; | ||
2+2 | ||
4 | ||
# | ||
# Test server signal handling with one-thread-per-connection handler | ||
# | ||
# restart:--log-error=MYSQLTEST_VARDIR/tmp/test_threadpool_sig_handler.err | ||
SELECT @@GLOBAL.thread_handling; | ||
@@GLOBAL.thread_handling | ||
one-thread-per-connection | ||
# Test SIGPIPE, SIGTSTP, SIGINT, which should be ignored | ||
# Test SIGHUP, which should result in status dump in the error log | ||
SELECT 1; | ||
1 | ||
1 | ||
# | ||
# Bug 805805: attaching to percona-server with gdb disconnects clients | ||
# Bug 1060136: safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT | ||
# | ||
SELECT 1; | ||
1 | ||
1 | ||
# | ||
# Bug 1537554: SIGTERM kills server instead of shutdown w/ threadpool | ||
# | ||
# restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Test server signal handling with threadpool | ||
# | ||
# restart:--log-error=MYSQLTEST_VARDIR/tmp/test_threadpool_sig_handler.err | ||
SELECT @@GLOBAL.thread_handling; | ||
@@GLOBAL.thread_handling | ||
pool-of-threads | ||
# Test SIGPIPE, SIGTSTP, SIGINT, which should be ignored | ||
# Test SIGHUP, which should result in status dump in the error log | ||
SELECT 1; | ||
1 | ||
1 | ||
# | ||
# Bug 805805: attaching to percona-server with gdb disconnects clients | ||
# Bug 1060136: safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT | ||
# | ||
SELECT 1; | ||
1 | ||
1 | ||
# | ||
# Bug 1537554: SIGTERM kills server instead of shutdown w/ threadpool | ||
# | ||
# restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
# A regression testcase for: | ||
# - bug 1060136: verifies that the server is not killed on SIGSTOP; | ||
# - bug 805805: verifies that the connection to the server is not killed on SIGSTOP/SIGCONT. | ||
--source include/not_embedded.inc | ||
--source include/not_windows.inc | ||
--source include/one_thread_per_connection.inc | ||
|
||
let $mysqld_pid_file=`SELECT @@GLOBAL.pid_file`; | ||
--echo # | ||
--echo # Test server signal handling with one-thread-per-connection handler | ||
--echo # | ||
|
||
exec kill -STOP `cat $mysqld_pid_file`; | ||
exec kill -CONT `cat $mysqld_pid_file`; | ||
|
||
SELECT 2+2; | ||
--source include/percona_signal_handling.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--thread-handling=pool-of-threads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--source include/not_embedded.inc | ||
--source include/not_windows.inc | ||
--source include/have_pool_of_threads.inc | ||
|
||
--echo # | ||
--echo # Test server signal handling with threadpool | ||
--echo # | ||
|
||
--source include/percona_signal_handling.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters