chia7712 commented on code in PR #17473: URL: https://github.com/apache/kafka/pull/17473#discussion_r1800477268
########## core/src/main/scala/kafka/network/SocketServer.scala: ########## @@ -1248,6 +1257,8 @@ private[kafka] class Processor( if (address != null) connectionQuotas.dec(listenerName, address) selector.close(connectionId) + // Call listeners to notify for closed connection. + connectionDisconnectListeners.foreach(listener => CoreUtils.swallow(() -> listener.onDisconnect(connectionId), this, Level.ERROR)) Review Comment: > The format they have is "<kafka_host_IP>-<kafka_port>-<remote_host_ip>-<remote_port>-<montonically_increasing_numer>". If this won't be unique then we would have bigger issues as Selector.java also keeps a map of connectionId to KafkaChannel which mutes or disconnect channels based on this connectionId. Yes, but the ID is only unique within the scope of a single process. Since `monotonically_increasing_number` is a local variable of each processor, it's possible for two processors to generate the same ID. Additionally, processors don't share the same selector, so the ID doesn't need to be globally unique. My concern was the duplicate id will corrupt the cache of (id -> UUID) -- 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