tolbertam commented on code in PR #3085:
URL: https://github.com/apache/cassandra/pull/3085#discussion_r1479203215


##########
src/java/org/apache/cassandra/transport/Server.java:
##########
@@ -306,6 +315,24 @@ int countConnectedClients()
             return allChannels.size() != 0 ? allChannels.size() - 1 : 0;
         }
 
+        int countConnectedClients(Predicate<ServerConnection> predicate)
+        {
+            int count = 0;
+            for (Channel c : allChannels)

Review Comment:
   I'd expect that even if the Channel is closed, the attributes will still be 
present. If the `ServerConnection` does happen to be null, the instanceof check 
will fail.  The `ClientState` on the `connection` (which the predicates 
evaluate) will never be null, so it should generally be safe.
   
   Also, if an exception is thrown here, the calling thread will be a JMX rmi 
connection thread, which will simply bubble the exception up to the client, so 
I think it will behave ok even in exceptional states.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to