This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new d61b87bd9b NIFI-13420 Maintain consistent maxNonHeapBytes for 
clustered diagnostics
d61b87bd9b is described below

commit d61b87bd9bff019a4fedb2fb628782dac79395c4
Author: Nissim Shiman <nshi...@yahoo.com>
AuthorDate: Wed Jun 19 19:29:55 2024 +0000

    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 <exceptionfact...@apache.org>
---
 .../src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java
index 44306e60d5..b20df287aa 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java
@@ -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());
-        target.setMaxNonHeapBytes(target.getMaxNonHeapBytes() + 
toMerge.getMaxNonHeapBytes());
+        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) {

Reply via email to