philipnee commented on code in PR #12862: URL: https://github.com/apache/kafka/pull/12862#discussion_r1035431454
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/DefaultBackgroundThread.java: ########## @@ -109,34 +129,31 @@ public void run() { try { runOnce(); } catch (final WakeupException e) { - log.debug( - "Exception thrown, background thread won't terminate", - e - ); - // swallow the wakeup exception to prevent killing the - // background thread. + log.debug("WakeupException caught, background thread won't be interrupted"); + // swallow the wakeup exception to prevent killing the background thread. } } } catch (final Throwable t) { - log.error( - "The background thread failed due to unexpected error", - t - ); - if (t instanceof RuntimeException) - this.exception.set(Optional.of((RuntimeException) t)); - else - this.exception.set(Optional.of(new RuntimeException(t))); + log.error("The background thread failed due to unexpected error", t); + throw new RuntimeException(t); } finally { close(); log.debug("{} closed", getClass()); } } /** - * Process event from a single poll + * Process event from a single poll. It performs the following tasks sequentially: + * 1. Try to poll and event from the queue, and try to process it. + * 2. Try to find Coordinator if needed + * 3. Try to send fetches. + * 4. Poll the networkClient for outstanding requests. If non: poll until next + * iteration. */ void runOnce() { + // TODO: we might not need the inflightEvent here Review Comment: Can we leave it to the next "minor" PR for the clean up? (per previous discussion) -- 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