~akopytov/percona-xtrabackup/bug1294782-2.1

Viewing all changes in revision 740.

  • Committer: Alexey Kopytov
  • Date: 2014-04-29 13:56:43 UTC
  • Revision ID: akopytov@gmail.com-20140429135643-oam4se6xby3n27xp
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.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: