NIFI-13420 Maintain consistent maxNonHeapBytes for clustered diagnostics

- The merged value of maxNonHeapBytes should be -1 when at least one node has that value

This closes #8983

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Nissim Shiman 2024-06-19 19:29:55 +00:00 committed by exceptionfactory
parent a774ff8120
commit d61b87bd9b
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -688,7 +688,11 @@ public class StatusMerger {
target.setFreeHeapBytes(target.getFreeHeapBytes() + toMerge.getFreeHeapBytes());
target.setFreeNonHeapBytes(target.getFreeNonHeapBytes() + toMerge.getFreeNonHeapBytes());
target.setMaxHeapBytes(target.getMaxHeapBytes() + toMerge.getMaxHeapBytes());
if (target.getMaxNonHeapBytes() != -1 && toMerge.getMaxNonHeapBytes() != -1) {
target.setMaxNonHeapBytes(target.getMaxNonHeapBytes() + toMerge.getMaxNonHeapBytes());
} else {
target.setMaxNonHeapBytes(-1L);
}
double systemLoad = target.getProcessorLoadAverage();
double toMergeSystemLoad = toMerge.getProcessorLoadAverage();
if (systemLoad >= 0 && toMergeSystemLoad >= 0) {