Make sure all child processes are killed on error

Reported by Alexey Kopytov on 2013-02-28
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup
Status tracked in 2.2
2.0
Undecided
Unassigned
2.1
High
Alexey Kopytov
2.2
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 Edit Tag help

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

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".

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

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.

Alexey Kopytov (akopytov) wrote :

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

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

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

tags: added: pxc
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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers