markap14 commented on code in PR #11607:
URL: https://github.com/apache/nifi/pull/11607#discussion_r3915577711
##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java:
##########
@@ -3072,6 +3071,39 @@ public boolean isConfiguredForClustering() {
return configuredForClustering;
}
+ @Override
+ public NodeConnectionState getNodeConnectionState() {
+ if (!isConfiguredForClustering()) {
+ return NodeConnectionState.STANDALONE;
+ }
+
+ final NodeIdentifier localNodeId = getNodeId();
+ final ClusterCoordinator coordinator = getClusterCoordinator();
+ if (localNodeId == null || coordinator == null) {
+ return NodeConnectionState.DISCONNECTED;
+ }
+
+ final NodeConnectionStatus localConnectionStatus =
coordinator.getConnectionStatus(localNodeId);
Review Comment:
[gpt-sol 5.6] This reads the coordinator’s cluster-wide status map instead
of `FlowController.connectionStatus`, which is the local state already used by
`isConnected()`. The two can differ while coordinator updates are in flight:
this method can continue returning `CONNECTING` after local connection
completes, or `CONNECTED` after local disconnection. Please map
`connectionStatus` here instead, and set it to `CONNECTING` before loading the
cluster flow so the NIP-37 startup case remains covered.
--
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]