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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user