boguszj commented on code in PR #11372:
URL: https://github.com/apache/nifi/pull/11372#discussion_r3491517828


##########
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java:
##########
@@ -4816,28 +4816,36 @@ public void setStatelessFlowTimeout(final String 
statelessFlowTimeout) {
     }
 
     private void setLoggingAttributes() {
-        loggingAttributes.clear();
+        final Map<String, String> attributes = new HashMap<>();
 
-        loggingAttributes.put(LoggingAttribute.PROCESS_GROUP_ID.attribute, id);
+        attributes.put(LoggingAttribute.PROCESS_GROUP_ID.attribute, id);
 
         final String processGroupName = name.get();
         if (processGroupName == null) {
-            
loggingAttributes.put(LoggingAttribute.PROCESS_GROUP_NAME.attribute, 
STANDARD_PROCESS_GROUP_NAME);
+            attributes.put(LoggingAttribute.PROCESS_GROUP_NAME.attribute, 
STANDARD_PROCESS_GROUP_NAME);
         } else {
-            
loggingAttributes.put(LoggingAttribute.PROCESS_GROUP_NAME.attribute, 
processGroupName);
-            setGroupPath();
+            attributes.put(LoggingAttribute.PROCESS_GROUP_NAME.attribute, 
processGroupName);
+            setGroupPath(attributes);
         }
 
         final VersionControlInformation currentVersionControl = 
versionControlInfo.get();
         if (currentVersionControl != null) {
             final String registeredFlowIdentifier = 
currentVersionControl.getFlowIdentifier();
-            
loggingAttributes.put(LoggingAttribute.REGISTERED_FLOW_IDENTIFIER.attribute, 
registeredFlowIdentifier);
+            
attributes.put(LoggingAttribute.REGISTERED_FLOW_IDENTIFIER.attribute, 
registeredFlowIdentifier);
 
             final String registeredFlowVersion = 
currentVersionControl.getVersion();
-            
loggingAttributes.put(LoggingAttribute.REGISTERED_FLOW_VERSION.attribute, 
registeredFlowVersion);
+            attributes.put(LoggingAttribute.REGISTERED_FLOW_VERSION.attribute, 
registeredFlowVersion);
         }
 
-        loggingAttributes.putAll(connectorLoggingAttributes);
+        attributes.putAll(connectorLoggingAttributes);
+
+        this.loggingAttributes = Map.copyOf(attributes);
+
+        for (final ProcessGroup childGroup : processGroups.values()) {
+            if (childGroup instanceof StandardProcessGroup standardChildGroup) 
{
+                standardChildGroup.setLoggingAttributes();

Review Comment:
   Initially I was thinking that this happens rarely enough that added 
computation is not a problem, so I kept things simple, but on another thought 
maybe being explicit about it is a better idea. I know boolean arguments 
probably aren't ideal, but since similar pattern is also used for 
`getControllerServices` I added one here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to