Fix problem with detecting wheter im processes has shutdown cleanly

parent 563a092f
...@@ -3485,23 +3485,20 @@ sub im_stop($) { ...@@ -3485,23 +3485,20 @@ sub im_stop($) {
} }
} }
# Check that all processes died. # Check if all processes shutdown cleanly
my $clean_shutdown= 1; # Assum they did
my $clean_shutdown= 0;
while (1)
{
if (kill (0, $instance_manager->{'pid'})) if (kill (0, $instance_manager->{'pid'}))
{ {
mtr_warning("IM-main is still alive."); mtr_warning("IM-main is still alive.");
last; $clean_shutdown= 0;
} }
if (defined $instance_manager->{'angel_pid'} && if (defined $instance_manager->{'angel_pid'} &&
kill (0, $instance_manager->{'angel_pid'})) kill (0, $instance_manager->{'angel_pid'}))
{ {
mtr_warning("IM-angel is still alive."); mtr_warning("IM-angel is still alive.");
last; $clean_shutdown= 0;
} }
foreach my $pid (@mysqld_pids) foreach my $pid (@mysqld_pids)
...@@ -3509,12 +3506,8 @@ sub im_stop($) { ...@@ -3509,12 +3506,8 @@ sub im_stop($) {
if (kill (0, $pid)) if (kill (0, $pid))
{ {
mtr_warning("Guarded mysqld ($pid) is still alive."); mtr_warning("Guarded mysqld ($pid) is still alive.");
last; $clean_shutdown= 0;
}
} }
$clean_shutdown= 1;
last;
} }
# Kill leftovers (the order is important). # Kill leftovers (the order is important).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment