chia7712 commented on code in PR #18337: URL: https://github.com/apache/kafka/pull/18337#discussion_r1907688757
########## test-common/test-common-api/src/test/java/org/apache/kafka/common/test/api/ClusterTestExtensionsTest.java: ########## @@ -347,6 +349,20 @@ public void testControllerListenerName(ClusterInstance cluster) throws Execution } } + @ClusterTest(types = {Type.KRAFT}) + public void testControllerRestart(ClusterInstance cluster) throws ExecutionException, InterruptedException { + try (Admin admin = cluster.admin()) { + + ControllerServer controller = cluster.controllers().values().iterator().next(); + controller.shutdown(); + controller.awaitShutdown(); Review Comment: Could you please add test for broker as well? the fix should works for broker, right? ########## test-common/src/main/java/org/apache/kafka/common/test/PreboundSocketFactoryManager.java: ########## @@ -49,7 +49,18 @@ public ServerSocketChannel openServerSocket( ServerSocketChannel socketChannel = getSocketForListenerAndMarkAsUsed( nodeId, listenerName); + if (socketChannel != null) { + if (socketChannel.isOpen()) { + return socketChannel; + } + // bind the server socket with same port Review Comment: Could you please add comments to explain the use cases of binding the same port? -- 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