Try to resolve the noderange bug, haven't produced it myself, so this is just a guess

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8786 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2011-02-02 20:51:58 +00:00
parent 0ce8e7cc6d
commit 0552dd32b3
2 changed files with 6 additions and 5 deletions

View File

@ -60,6 +60,11 @@ sub nodesmissed {
return @$missingnodes;
}
sub reset_db {
#workaround, something seems to be trying to use a corrupted reference to grptab
#this allows init_dbworker to reset the object
$grptab=0;
}
sub nodesbycriteria {
#TODO: this should be in a common place, shared by tabutils nodech/nodels and noderange
#there is a set of functions already, but the path is a little complicated and
@ -182,11 +187,6 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
# Try to match groups?
unless ($grptab) {
$grptab = xCAT::Table->new('nodegroup');
} else { # if DB2 we need to get a new table handle always
my $DBname = xCAT::Utils->get_DBName;
if (($DBname =~ /^DB2/) && (xCAT::Utils->isServiceNode())){
$grptab = xCAT::Table->new('nodegroup');
}
}
if ($grptab and not $didgrouplist and not scalar @grplist) {
$didgrouplist = 1;

View File

@ -151,6 +151,7 @@ sub init_dbworker {
$dbworkerpid = fork;
xCAT::NodeRange::reset_db(); #do in both processes, to be sure
unless (defined $dbworkerpid) {
die "Error spawining database worker";