safe_process.cc/safe_process.pl should not kill mysqld on SIGSTOP/SIGCONT
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Undecided
|
Laurynas Biveinis | ||
5.1 |
Fix Released
|
Undecided
|
Laurynas Biveinis | ||
5.5 |
Fix Released
|
Undecided
|
Laurynas Biveinis |
Bug Description
For Percona Server, this is prerequisite in testing bug 805805 fix in MTR.
Upstream description:
Description:
Currently safe_process.cc (and probably safe_process.pl too) handles SIGCHLD as if its child was terminated. That's the case for SIGTERM, SIGKILL etc. But safe_process also receives SIGCHLD for SIGSTOP, SIGCONT etc, which are non-fatal to the child.
How to repeat:
--source include/
let $mysqld_
system kill -STOP `cat $mysqld_pid_file`;
system kill -CONT `cat $mysqld_pid_file`;
# Server gone!
SELECT 2+2;
Suggested fix:
SIGCHLD handler should be installed with SA_NOCLDSTOP option:
@@ -152,11 +152,15 @@
pid_t own_pid= getpid();
pid_t parent_pid= getppid();
bool nocore = false;
+ struct sigaction sigchld_action;
+
+ sigchld_
+ sigchld_
/* Install signal handlers */
signal(SIGTERM, handle_signal);
signal(SIGINT, handle_signal);
- signal(SIGCHLD, handle_signal);
+ sigaction(SIGCHLD, &sigchld_action, NULL);
signal(SIGABRT, handle_abort);
sprintf(
Related branches
- Alexey Kopytov (community): Needs Fixing
-
Diff: 134 lines (+39/-6)6 files modifiedPercona-Server/configure.in (+6/-0)
Percona-Server/mysql-test/lib/My/SafeProcess/safe_process.cc (+4/-1)
Percona-Server/mysql-test/r/percona_signal_handling.result (+3/-0)
Percona-Server/mysql-test/t/percona_signal_handling.test (+8/-0)
Percona-Server/sql/net_serv.cc (+6/-2)
Percona-Server/vio/viosocket.c (+12/-3)
- Alexey Kopytov (community): Approve
-
Diff: 91 lines (+21/-3)4 files modifiedPercona-Server/mysql-test/lib/My/SafeProcess/safe_process.cc (+4/-1)
Percona-Server/mysql-test/r/percona_signal_handling.result (+3/-0)
Percona-Server/mysql-test/t/percona_signal_handling.test (+8/-0)
Percona-Server/sql/net_serv.cc (+6/-2)
- Alexey Kopytov (community): Approve
-
Diff: 94 lines (+24/-3)4 files modifiedPercona-Server/mysql-test/lib/My/SafeProcess/safe_process.cc (+4/-1)
Percona-Server/mysql-test/r/percona_signal_handling.result (+3/-0)
Percona-Server/mysql-test/t/percona_signal_handling.test (+11/-0)
Percona-Server/sql/net_serv.cc (+6/-2)
- Laurynas Biveinis (community): Approve
- Alexey Kopytov: Pending requested
-
Diff: 94 lines (+24/-3)4 files modifiedPercona-Server/mysql-test/lib/My/SafeProcess/safe_process.cc (+4/-1)
Percona-Server/mysql-test/r/percona_signal_handling.result (+3/-0)
Percona-Server/mysql-test/t/percona_signal_handling.test (+11/-0)
Percona-Server/sql/net_serv.cc (+6/-2)
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-2812