You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/02/11 18:08:37 UTC

[GitHub] [nifi] markap14 commented on a change in pull request #4045: NIFI-7117: When SocketLoadBalancedFlowFileQueue creates its array of …

markap14 commented on a change in pull request #4045: NIFI-7117: When SocketLoadBalancedFlowFileQueue creates its array of …
URL: https://github.com/apache/nifi/pull/4045#discussion_r377806864
 
 

 ##########
 File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/SocketLoadBalancedFlowFileQueue.java
 ##########
 @@ -151,15 +151,19 @@ public SocketLoadBalancedFlowFileQueue(final String identifier, final Connection
             // that is not the local node identifier. If the Local Node Identifier is not yet known, that's okay. When it becomes known,
             // the queuePartitions array will be recreated with the appropriate partitions.
             final List<QueuePartition> partitionList = new ArrayList<>();
-            partitionList.add(localPartition);
 
             final NodeIdentifier localNodeId = clusterCoordinator.getLocalNodeIdentifier();
             for (final NodeIdentifier nodeId : sortedNodeIdentifiers) {
                 if (nodeId.equals(localNodeId)) {
-                    continue;
+                    partitionList.add(localPartition);
+                } else {
+                    partitionList.add(createRemotePartition(nodeId));
                 }
+            }
 
-                partitionList.add(createRemotePartition(nodeId));
+            // Ensure that our list of queue partitions always contains the local partition.
 
 Review comment:
   Yes, `clusterCoordinator.getLocalNodeIdentifier()` can return `null`. In that case, the local partition will never be added in the loop.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services