chia7712 opened a new pull request, #13395: URL: https://github.com/apache/kafka/pull/13395
the unsent request stored by `InterBrokerSendThread` uses stale controller even though the `NetworkClient` is reset already. The request will get error `NOT_CONTROLLER`, and then the error handle will try to disconnect the "new" controller. The new controller is not connected so the call `networkClient.disconnect(controllerAddress.idString)` will cause following error. ``` java.lang.IllegalStateException: No entry found for connection 1000 at org.apache.kafka.clients.ClusterConnectionStates.nodeState(ClusterConnectionStates.java:411) at org.apache.kafka.clients.ClusterConnectionStates.disconnected(ClusterConnectionStates.java:182) at org.apache.kafka.clients.NetworkClient.disconnect(NetworkClient.java:328) at kafka.server.BrokerToControllerRequestThread.$anonfun$handleResponse$9(BrokerToControllerChannelManager.scala:405) at kafka.server.BrokerToControllerRequestThread.$anonfun$handleResponse$9$adapted(BrokerToControllerChannelManager.scala:402) at scala.Option.foreach(Option.scala:437) at kafka.server.BrokerToControllerRequestThread.handleResponse(BrokerToControllerChannelManager.scala:402) at kafka.server.BrokerToControllerRequestThread.$anonfun$generateRequests$1(BrokerToControllerChannelManager.scala:377) at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:154) at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:594) at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:586) at kafka.common.InterBrokerSendThread.pollOnce(InterBrokerSendThread.scala:78) at kafka.server.BrokerToControllerRequestThread.doWork(BrokerToControllerChannelManager.scala:422) at org.apache.kafka.server.util.ShutdownableThread.run(ShutdownableThread.java:127) ``` This is not a critical bug since we swallow the exception, but the error is a bit scare to me when testing zk migration :) ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- 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