diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 4895381fd..c82bea962 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -184,6 +184,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels if ($recurselevel > 4096) { die "NodeRange seems to be hung on evaluating $atom, recursion limit hit"; } unless (scalar(@allnodeset) and (($allnodesetstamp+5) > time())) { #Build a cache of all nodes, some corner cases will perform worse, but by and large it will do better. We could do tests to see where the breaking points are, and predict how many atoms we have to evaluate to mitigate, for now, implement the strategy that keeps performance from going completely off the rails $allnodesetstamp=time(); + $nodelist->_set_use_cache(1); @allnodeset = $nodelist->getAllAttribs('node','groups'); %allnodehash = map { $_->{node} => 1 } @allnodeset; } diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 2b0537c10..051e5b7ec 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -2122,7 +2122,8 @@ sub _clear_cache { #PRIVATE FUNCTION TO EXPIRE CACHED DATA EXPLICITLY $self->{_cache_ref} -= 1; return; } elsif ($self->{_cache_ref} == 1) { #If it is 1, decrement to zero and carry on - $self->{_cache_ref} = 0; + return; + #$self->{_cache_ref} = 0; } #it shouldn't have been zero, but whether it was 0 or 1, ensure that the cache is gone $self->{_use_cache}=0; # Signal slow operation to any in-flight operations that may fail with empty cache