diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2022-07-18 23:16:18 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2022-07-18 23:16:18 +0300 |
commit | 7ca5c7d8f9c70067db36b76da31671fae430cc9d (patch) | |
tree | 7bec5d8ecb1595536fa55c16bc22b037634b00b1 | |
parent | 1d307ed48a81975cc8a322379b0c6e051d53a44d (diff) | |
download | mariadb-git-7ca5c7d8f9c70067db36b76da31671fae430cc9d.tar.gz |
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().
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f3ffdf90547..bb044a1388b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -661,12 +661,14 @@ sub main { foreach my $pid (keys %children) { my $ret_pid= waitpid($pid, 0); - if ($ret_pid != $pid){ - mtr_report("Unknown process $ret_pid exited"); - } - else { - delete $children{$ret_pid}; + if ($ret_pid == -1) { + # 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}"); } + delete $children{$ret_pid}; } } |