lianetm commented on PR #15640:
URL: https://github.com/apache/kafka/pull/15640#issuecomment-2087355371

   > > Here I have a comment, I could not put at the right location in the code:
   > > 
   > > On line 1362, in commitSync() the consumer waits on the commitFuture 
with a timer. I think, it should not wait on a timer there since we already 
wait on a timer in the background thread.
   > 
   > I agree. What about the timed wait in 
awaitPendingAsyncCommitsAndExecuteCommitCallbacks()?
   
   Agree we should not wait on the `commitFuture` with a timer because the 
deadline is contained in the event we submitted, and already enforced by the 
reaper, and not clear about what the proposed relationship with 
`awaitPendingAsyncCommitsAndExecuteCommitCallbacks` is??
   
   I would expect we only need to call 
`ConsumerUtils.getResult(commitFuture);`, and that is consistent with how we 
get results for all other completable events now:
   - we create an event with a deadline
   - we call `applicationEventHandler.addAndGet(event)`   
   For the commit case that flow has a different shape just because we use 
`applicationEventHandler.add(event)` 
[here](https://github.com/apache/kafka/blob/097522abd6b51bca2407ea0de7009ed6a2d970b4/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L775),
 to cater for commit sync and async, but we should still apply the same 
approach and just call get without any time boundary I would say. 


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