740
|
|
Bug #1294782: Innobackupex hangs on fatal error in some cases
The problem was that the code in both innobackupex and xtrabackup, that was supposed to make sure no child processes are left running in case innobackupex got killed or failed with an error, relied on the fact the SIGTERM and SIGINT signals were not blocked by the xtrabackup process (or any other child processes spawned by innobackupex).
When innobackupex terminates gracefully, it calls kill_child_processes() to send SIGTERM to its children.
There’s also (Linux-specific) auto-termination logic in xtrabackup for cases when innobackupex is killed or terminates ungracefully. It worked as follows: the xtrabackup process called prctl(PR_SET_PDEATHSIG, SIGINT) on start, so that SIGINT is sent automatically in case the parent process (innobackupex) dies.
However, both SIGTERM and SIGINT might be blocked by the process that had invoked innobackupex, for example, by the PXC server processes doing an SST, in which case they were also blocked by the xtrabackup process, since the signal mask is inherited by child processes.
Fixed by replacing SIGTERM in innobackupex and SIGINT in xtrabackup auto-termination with SIGKILL.
Also removed some ancient code around FTWRL. It has been unnecessary for a long time, which has been reported in duplicate bug #1311120.
No test case, as it is impossible in Bash to create a signal mask that would be inherited by child processes. Signal masks created by ‘trap’ are only inherited by built-in commands according to the manual.
|
Alexey Kopytov |
10 years ago
|
|
|
739
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
738
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
737
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
736
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
735
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
734
|
|
|
Hrvoje Matijakovic |
10 years ago
|
|
|
733
|
|
|
Hrvoje Matijakovic |
10 years ago
|
|
|
732
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
731
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
730
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
729
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
728
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
727
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
726
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
725
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
724
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
723
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
722
|
|
|
Alexey Kopytov |
10 years ago
|
|
|
721
|
|
|
Alexey Kopytov |
10 years ago
|
|
|