From 54fc7ea33b932fb856fbda5034ceaa77199e4856 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 5 Feb 2008 15:45:58 +0000 Subject: [PATCH] -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 --- perl-xCAT-2.0/xCAT/Postage.pm | 4 ++++ perl-xCAT-2.0/xCAT/Template.pm | 4 ++++ xCAT-server-2.0/sbin/xcatd | 12 ++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/Postage.pm b/perl-xCAT-2.0/xCAT/Postage.pm index a3575b9f6..d908d0fcc 100644 --- a/perl-xCAT-2.0/xCAT/Postage.pm +++ b/perl-xCAT-2.0/xCAT/Postage.pm @@ -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'}; diff --git a/perl-xCAT-2.0/xCAT/Template.pm b/perl-xCAT-2.0/xCAT/Template.pm index 759b39c86..8d8ce1da0 100755 --- a/perl-xCAT-2.0/xCAT/Template.pm +++ b/perl-xCAT-2.0/xCAT/Template.pm @@ -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'}; diff --git a/xCAT-server-2.0/sbin/xcatd b/xCAT-server-2.0/sbin/xcatd index 88a8a7386..6cc21c518 100755 --- a/xCAT-server-2.0/sbin/xcatd +++ b/xCAT-server-2.0/sbin/xcatd @@ -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; }