mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-30 09:36:41 +00:00
Fix race condition issue when printing message in xcatd
related-issue: #729 related-commit: #742
This commit is contained in:
parent
7b6cbf9ee4
commit
7fd99442c7
@ -1897,15 +1897,20 @@ sub plugin_command {
|
||||
$xcatresponses{xcatresponse}=[];
|
||||
}
|
||||
}
|
||||
if (scalar(@{$xcatresponses{xcatresponse}})) {
|
||||
send_response(\%xcatresponses,$sock);
|
||||
$xcatresponses{xcatresponse}=[];
|
||||
}
|
||||
if ($check_fds->count > 0) {
|
||||
my %resp_timeout = ('errorcode'=>[1],
|
||||
'data'=>["Warning: Process terminated due to IO timeout, the following output may not complete.\n"]);
|
||||
push @{$xcatresponses{xcatresponse}},\%resp_timeout;
|
||||
my $count = scalar(@{$xcatresponses{xcatresponse}});
|
||||
relay_fds($check_fds,$xcatresponses{xcatresponse});
|
||||
}
|
||||
if (scalar(@{$xcatresponses{xcatresponse}})) {
|
||||
send_response(\%xcatresponses,$sock);
|
||||
$xcatresponses{xcatresponse}=[];
|
||||
if (scalar(@{$xcatresponses{xcatresponse}}) != $count) {
|
||||
send_response(\%xcatresponses,$sock);
|
||||
$xcatresponses{xcatresponse}=[];
|
||||
}
|
||||
}
|
||||
#while (relay_fds($check_fds,$sock)) {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user