mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fix a race on some platforms in mysql-test-run.pl, where it would sometimes
errorneously abort reporting failure to kill child processes, where in reality the problem was merely that the child had become a zombie because of missing waitpid() call. mysql-test/lib/mtr_process.pl: Fix race (on some platforms) when killing processes.
This commit is contained in:
@ -770,7 +770,15 @@ sub mtr_record_dead_children () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub start_reap_all {
|
sub start_reap_all {
|
||||||
$SIG{CHLD}= 'IGNORE'; # FIXME is this enough?
|
# This causes terminating processes to not become zombies, avoiding
|
||||||
|
# the need for (or possibility of) explicit waitpid().
|
||||||
|
$SIG{CHLD}= 'IGNORE';
|
||||||
|
|
||||||
|
# On some platforms (Linux, QNX, OSX, ...) there is potential race
|
||||||
|
# here. If a process terminated before setting $SIG{CHLD} (but after
|
||||||
|
# any attempt to waitpid() it), it will still be a zombie. So we
|
||||||
|
# have to handle any such process here.
|
||||||
|
while(waitpid(-1, &WNOHANG) > 0) { };
|
||||||
}
|
}
|
||||||
|
|
||||||
sub stop_reap_all {
|
sub stop_reap_all {
|
||||||
|
Reference in New Issue
Block a user