You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/08/26 09:33:40 UTC

[GitHub] [kafka] showuon commented on a diff in pull request #12559: MINOR: add logs when connection count exceeds configured count

showuon commented on code in PR #12559:
URL: https://github.com/apache/kafka/pull/12559#discussion_r955857743


##########
core/src/main/scala/kafka/network/SocketServer.scala:
##########
@@ -1561,12 +1566,15 @@ class ConnectionQuotas(config: KafkaConfig, time: Time, metrics: Metrics) extend
   }
 
   private def connectionSlotAvailable(listenerName: ListenerName): Boolean = {
-    if (listenerCounts(listenerName) >= maxListenerConnections(listenerName))
+    if (listenerCounts(listenerName) >= maxListenerConnections(listenerName)) {
+      warn(s"The connection count ${listenerCounts(listenerName)} for listener:$listenerName exceeds max listener connection count ${maxListenerConnections(listenerName)}")
       false
-    else if (protectedListener(listenerName))
+    } else if (protectedListener(listenerName)) {
       true
-    else
-      totalCount < brokerMaxConnections
+    } else if (totalCount >= brokerMaxConnections) {
+      warn(s"The total connection count $totalCount exceeds broker max connection count $brokerMaxConnections")
+      false
+    } else true
   }

Review Comment:
   Adds log for different cases without available connection slot



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org