chia7712 commented on code in PR #20283:
URL: https://github.com/apache/kafka/pull/20283#discussion_r2319988221


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:
##########
@@ -1116,19 +1116,23 @@ private boolean processBackgroundEvents() {
 
         LinkedList<BackgroundEvent> events = new LinkedList<>();
         backgroundEventQueue.drainTo(events);
+        if (!events.isEmpty()) {

Review Comment:
   `BackgroundEventHandler#drainEvents` is not used, so the metrics 
`background-event-queue-size` is never reset to zero. One option could be to 
call `asyncConsumerMetrics.recordBackgroundEventQueueSize(0)` manually. 
Alternatively, `ShareConsumerImpl` could use `BackgroundEventHandler` instead 
of `backgroundEventQueue`, similar to `AsyncKafkaConsumer`



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