mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-29023 waitpid() cleanup
The case for "Unknown process $ret_pid exited" is never known to be valid. Such state is not documented for waitpid().
This commit is contained in:
@@ -661,14 +661,16 @@ sub main {
|
|||||||
foreach my $pid (keys %children)
|
foreach my $pid (keys %children)
|
||||||
{
|
{
|
||||||
my $ret_pid= waitpid($pid, 0);
|
my $ret_pid= waitpid($pid, 0);
|
||||||
if ($ret_pid != $pid){
|
if ($ret_pid == -1) {
|
||||||
mtr_report("Unknown process $ret_pid exited");
|
# Child was automatically reaped. Probably not possible
|
||||||
|
# unless you $SIG{CHLD}= 'IGNORE'
|
||||||
|
mtr_report("Child ${pid} was automatically reaped (this should never happend)");
|
||||||
|
} elsif ($ret_pid != $pid) {
|
||||||
|
confess("Unexpected PID ${ret_pid} instead of expected ${pid}");
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
delete $children{$ret_pid};
|
delete $children{$ret_pid};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( not @$completed ) {
|
if ( not @$completed ) {
|
||||||
mtr_error("Test suite aborted");
|
mtr_error("Test suite aborted");
|
||||||
|
Reference in New Issue
Block a user