chirag-wadhwa5 commented on code in PR #21001:
URL: https://github.com/apache/kafka/pull/21001#discussion_r2567382066


##########
core/src/main/scala/kafka/server/BrokerServer.scala:
##########
@@ -635,7 +635,8 @@ class BrokerServer(
         new LogContext(s"[NetworkPartitionMetadataClient 
broker=${config.brokerId}]")
       ),
       Time.SYSTEM,
-      config.interBrokerListenerName()
+      config.interBrokerListenerName(),
+      new SystemTimerReaper("network-partition-metadata-client-reaper", new 
SystemTimer("network-partition-metadata-client"))

Review Comment:
   I think so. The reason is that the timeout for a poll in the 
InterBrokerSendThread is LONG_MAX_VALUE. This is so that continuous polling 
does not happen, thereby wasting CPU cycles. So, when a request is enqueued, a 
corresponding wakeup call follows it to make sure that it is executed. In the 
case of retries, enqueuing the request at the right time is one part, but we 
also need to call wakeup when the backoff ms time passes. So, timer task was a 
good option here.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to