-Stop forking off nodeset next on installmonitor request, avoid race condition

-Prevent empty responses from triggering bug warning in the dispatch_callback
-Give servicenode attribute value weight in $master deterimination in templates and postage


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@396 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-02-05 15:45:58 +00:00
parent 8c96057ff1
commit 54fc7ea33b
3 changed files with 16 additions and 4 deletions

View File

@ -36,6 +36,10 @@ sub writescript {
if ($et and $et->{value}) {
$master = $et->{value};
}
$et = $noderestab->getNodeAttribs($node,['servicenode']);
if ($et and $et->{'servicenode'}) {
$master = $et->{'servicenode'};
}
$et = $noderestab->getNodeAttribs($node,['xcatmaster']);
if ($et and $et->{'xcatmaster'}) {
$master = $et->{'xcatmaster'};

View File

@ -45,6 +45,10 @@ sub subvars {
if ($et and $et->{value}) {
$master = $et->{value};
}
$et = $noderestab->getNodeAttribs($node,['servicenode']);
if ($et and $et->{'servicenode'}) {
$master = $et->{'servicenode'};
}
$et = $noderestab->getNodeAttribs($node,['xcatmaster']);
if ($et and $et->{'xcatmaster'}) {
$master = $et->{'xcatmaster'};

View File

@ -158,11 +158,12 @@ if (xCAT::Utils->isLinux()) {
arg => [ 'next' ],
);
close($conn);
my $pid=xCAT::Utils->xfork();
unless ($pid) { #fork off the nodeset and potential slowness
#node should be blocked, race condition may occur otherwise
#my $pid=xCAT::Utils->xfork();
#unless ($pid) { #fork off the nodeset and potential slowness
plugin_command(\%request,undef,\&convey_response);
exit(0);
}
# exit(0);
#}
} elsif ($text =~ /^unlocktftpdir/) { #TODO: only nodes in install state should be allowed
close($conn);
mkpath("$tftpdir/xcat/$node");
@ -579,6 +580,9 @@ my $dispatch_cb;
my $dispatch_parentfd;
sub dispatch_callback {
my $rspo = shift;
unless ($rspo) {
return;
}
my $rsp = {%$rspo}; # deep copy
delete $rsp->{serverdone};
unless (%$rsp) { return; }