Make sure all child processes are killed on error

Bug #1135441 reported by Alexey Kopytov
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
High
Alexey Kopytov
2.0
Won't Fix
Undecided
Unassigned
2.1
Fix Released
High
Alexey Kopytov
2.2
Fix Released
High
Alexey Kopytov

Bug Description

innobackupex tries to make sure all child processes are killed if an error occurs in the script. This is performed by the Die subroutine.

However, it is not used consistently. In some parts of code Die is used, while other parts use "die" (i.e. just terminate innobackupex without any cleanups).

We should make sure the cleanup is performed regardless of the error type and the part of code where it has occurred.

Tags: pxc

Related branches

Revision history for this message
Stewart Smith (stewart) wrote : Re: [Bug 1135441] [NEW] Make sure all child processes are killed on error

Alexey Kopytov <email address hidden> writes:
> However, it is not used consistently. In some parts of code Die is used,
> while other parts use "die" (i.e. just terminate innobackupex without
> any cleanups).

I think we should be able to add a END {} block and get rid of Die, thus
making everything consistent

--
Stewart Smith

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Hi Stewart,

On Fri, 01 Mar 2013 16:31:31 -0000, Stewart Smith wrote:
> Alexey Kopytov <email address hidden> writes:
>> However, it is not used consistently. In some parts of code Die is used,
>> while other parts use "die" (i.e. just terminate innobackupex without
>> any cleanups).
>
> I think we should be able to add a END {} block and get rid of Die, thus
> making everything consistent
>

That seems to be the only portable solution. Though END{} does not save
us from "killall -9 innobackupex".

Revision history for this message
Stewart Smith (stewart) wrote :

Alexey Kopytov <email address hidden> writes:
>> I think we should be able to add a END {} block and get rid of Die, thus
>> making everything consistent
>>
>
> That seems to be the only portable solution. Though END{} does not save
> us from "killall -9 innobackupex".

I don't think anything can save us there can it...

--
Stewart Smith

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Hi Stewart,

On Wed, 06 Mar 2013 05:26:26 -0000, Stewart Smith wrote:
> Alexey Kopytov <email address hidden> writes:
>>> I think we should be able to add a END {} block and get rid of Die, thus
>>> making everything consistent
>>>
>>
>> That seems to be the only portable solution. Though END{} does not save
>> us from "killall -9 innobackupex".
>
> I don't think anything can save us there can it...
>

There's prctl(PR_SET_PDEATHSIG), but that's not portable. Actually that
would be portable enough for us. And since we will get rid of the mysql
command line client in 2.1, that should also be good enough.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Bug #858051 was marked as a duplicate of this one.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Also Die doesn't take care of keepalive processes in 2.1.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Added PXC to track this and add a possible workaround till then.

tags: added: pxc
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Since this would require 2 different versions of the fix for 2.0 and 2.1, closing as Won't Fix for 2.0.

no longer affects: percona-xtradb-cluster
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-40

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.