2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-13 18:00:38 +00:00

if not get valid pid when waitpid, sleep (#5274)

This commit is contained in:
xuweibj
2018-06-01 14:30:53 +08:00
committed by Bin Xu
parent 84ba10fad6
commit 12bfd5699d

View File

@ -1088,8 +1088,10 @@ rmdir \"/tmp/\$userid\" \n";
}
if (%child_node_map) {
my $pid_flag = 0;
while ((my $cpid = waitpid(-1, WNOHANG)) > 0) {
if ($child_node_map{$cpid}) {
$pid_flag = 1;
my $node = $child_node_map{$cpid};
my $rc = $? >> 8;
if ($rc != 0) {
@ -1107,6 +1109,9 @@ rmdir \"/tmp/\$userid\" \n";
delete $child_node_map{$cpid};
}
}
unless ($pid_flag) {
select(undef, undef, undef, 0.01);
}
}
my @del;
while (my ($k, $v) = each %node_wait) {