pvillard31 commented on code in PR #11715:
URL: https://github.com/apache/nifi/pull/11715#discussion_r4142865844


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java:
##########
@@ -3114,22 +3114,16 @@ public boolean isConfiguredForClustering() {
 
     @Override
     public NodeConnectionState getNodeConnectionState() {
-        final NodeConnectionState nodeConnectionState;
+        if (!configuredForClustering) {
+            return NodeConnectionState.STANDALONE;
+        }
 
-        readLock.lock();
-        try {
-            if (!configuredForClustering) {
-                nodeConnectionState = NodeConnectionState.STANDALONE;
-            } else if (connectionStatus == null) {
-                nodeConnectionState = NodeConnectionState.DISCONNECTED;
-            } else {
-                nodeConnectionState = 
mapNodeConnectionState(connectionStatus.getState());
-            }
-        } finally {
-            readLock.unlock("getNodeConnectionState");
+        final NodeConnectionStatus localConnectionStatus = connectionStatus;
+        if (localConnectionStatus == null) {
+            return NodeConnectionState.DISCONNECTED;
         }
 
-        return nodeConnectionState;
+        return mapNodeConnectionState(localConnectionStatus.getState());

Review Comment:
   done



-- 
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