Increase discovery performance and resolve stale blade macmap issue.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@272 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
d24ce878e0
commit
872284c2d3
@ -79,3 +79,5 @@ if [ -d /proc/device-tree/lhea* ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
#Give 10 seconds for things to quiesce.
|
||||
sleep 10
|
||||
|
@ -36,6 +36,7 @@ my %usage = (
|
||||
"rscan" => "Usage: rscan <noderange> [-w][-x|-z]"
|
||||
);
|
||||
my %macmap; #Store responses from rinv for discovery
|
||||
my $macmaptimestamp; #reflect freshness of cache
|
||||
my $mmprimoid = '1.3.6.1.4.1.2.3.51.2.22.5.1.1.4';#mmPrimary
|
||||
my $beaconoid = '1.3.6.1.4.1.2.3.51.2.2.8.2.1.1.11'; #ledBladeIdentity
|
||||
my $powerstatoid = '1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.4';#bladePowerState
|
||||
@ -885,7 +886,13 @@ sub process_request {
|
||||
unless ($mac) { return };
|
||||
|
||||
#Only refresh the the cache when the request permits and no useful answer
|
||||
unless ($request->{cacheonly}->[0] or $macmap{$mac}) {
|
||||
if ($macmaptimestamp < (time() - 300)) { #after five minutes, invalidate cache
|
||||
%macmap = ();
|
||||
}
|
||||
|
||||
unless ($request->{cacheonly}->[0] or $macmap{$mac} or $macmaptimestamp > (time() - 20)) { #do not refresh cache if requested not to, if it has an entry, or is recent
|
||||
%macmap = ();
|
||||
$macmaptimestamp=time();
|
||||
process_request(\%invreq,\&fillresps);
|
||||
}
|
||||
unless ($macmap{$mac}) {
|
||||
|
Loading…
Reference in New Issue
Block a user