You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ex...@apache.org on 2026/01/28 04:55:13 UTC

(nifi) branch main updated: NIFI-15410 Improved auditing of stopping RemoteProcessGroups (#10817)

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 3611a2fe93 NIFI-15410 Improved auditing of stopping RemoteProcessGroups (#10817)
3611a2fe93 is described below

commit 3611a2fe93f4cb2acbba3778d1254569952cf25f
Author: NissimShiman <57...@users.noreply.github.com>
AuthorDate: Tue Jan 27 23:55:06 2026 -0500

    NIFI-15410 Improved auditing of stopping RemoteProcessGroups (#10817)
    
    Signed-off-by: David Handermann <ex...@apache.org>
---
 .../java/org/apache/nifi/audit/RemoteProcessGroupAuditor.java | 11 ++++++-----
 .../org/apache/nifi/audit/TestRemoteProcessGroupAuditor.java  |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/RemoteProcessGroupAuditor.java b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/RemoteProcessGroupAuditor.java
index 04c34de10d..5d420765a1 100644
--- a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/RemoteProcessGroupAuditor.java
+++ b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/RemoteProcessGroupAuditor.java
@@ -289,16 +289,17 @@ public class RemoteProcessGroupAuditor extends NiFiAuditor {
             }
 
             // determine the new executing state
-            boolean updatedTransmissionState = updatedRemoteProcessGroup.isTransmitting();
-
-            // determine if the running state has changed
-            if (transmissionState != updatedTransmissionState) {
+            // using isConfiguredToTransmit() as opposed to isTransmitting()
+            // to capture case where port is still in process of shutting down.
+            boolean updatedConfiguredToTransmitState = updatedRemoteProcessGroup.isConfiguredToTransmit();
+            // determine if the running state has been set to change
+            if (transmissionState != updatedConfiguredToTransmitState) {
                 // create a remote process group action
                 final FlowChangeAction remoteProcessGroupAction = createFlowChangeAction(timestamp,
                         updatedRemoteProcessGroup, remoteProcessGroupDetails);
 
                 // set the operation accordingly
-                if (updatedTransmissionState) {
+                if (updatedConfiguredToTransmitState) {
                     remoteProcessGroupAction.setOperation(Operation.Start);
                 } else {
                     remoteProcessGroupAction.setOperation(Operation.Stop);
diff --git a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/audit/TestRemoteProcessGroupAuditor.java b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/audit/TestRemoteProcessGroupAuditor.java
index 1131faa06e..490730f175 100644
--- a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/audit/TestRemoteProcessGroupAuditor.java
+++ b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/audit/TestRemoteProcessGroupAuditor.java
@@ -82,7 +82,7 @@ public class TestRemoteProcessGroupAuditor {
         // Setup updatedRPG mock based on inputRPGDTO.
         final RemoteProcessGroup updatedRPG = mock(RemoteProcessGroup.class);
         when(updatedRPG.getIdentifier()).thenReturn(remoteProcessGroupId);
-        when(updatedRPG.isTransmitting()).thenReturn(inputRPGDTO.isTransmitting());
+        when(updatedRPG.isConfiguredToTransmit()).thenReturn(inputRPGDTO.isTransmitting());
         when(updatedRPG.getCommunicationsTimeout()).thenReturn(inputRPGDTO.getCommunicationsTimeout());
         when(updatedRPG.getYieldDuration()).thenReturn(inputRPGDTO.getYieldDuration());
         when(updatedRPG.getTransportProtocol())