cmccabe commented on code in PR #11969:
URL: https://github.com/apache/kafka/pull/11969#discussion_r868764971


##########
core/src/main/scala/kafka/network/SocketServer.scala:
##########
@@ -1864,6 +1780,18 @@ class ConnectionQuotas(config: KafkaConfig, time: Time, 
metrics: Metrics) extend
       sensor
     }
   }
+
+  /**
+   * Close `channel` and decrement the connection count.
+   */
+  def closeChannel(listenerName: ListenerName, channel: SocketChannel): Unit = 
{
+    if (channel != null) {
+      debug(s"Closing connection from 
${channel.socket.getRemoteSocketAddress}")
+      dec(listenerName, channel.socket.getInetAddress)
+      closeSocket(channel, this)

Review Comment:
   I guess to me, when you have something that is limiting the number of X 
objects, it makes sense for that thing to be logging about opening / closing 
the X objects as well. Then you can add helpful info about how many X objects 
there are, and so forth (in theory, I don't think we do that here).
   
   So really this thing shouldn't be a "quotas" class but more like a pool or 
something. But we've changed enough in this PR, so let's not go there :)
   
   Anyway, I will move it around, although we'll end up with some 4 or 5 
argument utility functions.



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to