soarez commented on code in PR #14903:
URL: https://github.com/apache/kafka/pull/14903#discussion_r1417116727


##########
core/src/main/scala/kafka/server/BrokerLifecycleManager.scala:
##########
@@ -166,6 +166,19 @@ class BrokerLifecycleManager(
    */
   private var registered = false
 
+  /**
+   * True if a request has been sent and a response or timeout has not yet 
been processed.
+   * This variable can only be read or written from the event queue thread.
+   */
+  private var communicationInFlight = false

Review Comment:
   I don't see a straightforward way to do this.
   
   Maybe I'm missing something, but`NetworkClient` does not look like a good 
place for this. `kafka.server.NodeToControllerChannelManagerImpl#sendRequest` 
isn't synchronous, it runs `requestThread.enqueue`, so if we rely on 
`networkClient` state we open the door to race conditions.
   Also, `NodeToControllerRequestThread` can reset the network client at any 
point.
   



-- 
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