lianetm commented on code in PR #21495:
URL: https://github.com/apache/kafka/pull/21495#discussion_r2822863168


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:
##########
@@ -817,11 +817,13 @@ private void transitionToStale() {
      *  - There are topics that haven't been added to the current assignment 
yet, but all their topic IDs
      *    are missing from the target assignment.
      *
-     * @param canCommit Controls whether reconciliation can proceed when 
auto-commit is enabled.
-     *                  Set to true only when the current offset positions are 
safe to commit.
-     *                  If false and auto-commit enabled, the reconciliation 
will be skipped.
+     * @param invokedByPoll True if this reconciliation attempt is triggered 
by the application thread on consumer.poll().
+     *                      False if this is triggered by the background 
thread on regular manager poll.
+     *                      In both cases we want to resolve metadata to 
unresolved assignments,
+     *                      but the actual reconciliation (commit, callbacks, 
assignment updates)
+     *                      will only proceed if this is triggered from the 
application thread on consumer.poll
      */
-    public void maybeReconcile(boolean canCommit) {
+    public void maybeReconcile(boolean invokedByPoll) {

Review Comment:
   even though we don't wait for the AsyncPollEvent to complete, the 
consumer.poll does wait for part of it (and the maybeReconcile happens within 
the waiting section). This is the call that unblocks the poll, after the maybe 
reconcile and other stuff: 
https://github.com/apache/kafka/blob/75a84116b384705cef036dfa95781d85fcda5b24/clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java#L739
   
   Double checking it all, this whole "not fully blocking on AsyncPollEvent" is 
recent improvement for perf. 



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