divijvaidya commented on code in PR #12559:
URL: https://github.com/apache/kafka/pull/12559#discussion_r955882782
##########
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:
Should these be `info` or `debug` level logs? Saying this because a rogue
client will get throttled but still have a potential to overwhelm the server
with filled up logs. Also, `warn` is usually used to indicate an error which
the system has recovered/ could recover from but needs attention, whereas,
getting throttled is a client side error in the same bucket as HTTP 4xx series.
What do you think?
--
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]