From 0552dd32b3868dfe869877b37fee897c47592f70 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 2 Feb 2011 20:51:58 +0000 Subject: [PATCH] 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 --- perl-xCAT/xCAT/NodeRange.pm | 10 +++++----- perl-xCAT/xCAT/Table.pm | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 453133662..984329810 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -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; diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index ecc0b7bfd..63ced6a9c 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -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";