lucasbru opened a new pull request, #15437:
URL: https://github.com/apache/kafka/pull/15437

   The javadocs for `commitAsync()` (w/o callback) say:
   ```
   @throws org.apache.kafka.common.errors.FencedInstanceIdException 
   if this consumer instance gets fenced by broker.
   ```
    
   If no callback is passed into `commitAsync()`, no offset commit callback 
invocation is submitted. However, we only check for a 
`FencedInstanceIdException` when we execute a callback. When the consumer gets 
fenced by another consumer with the same `group.instance.id`, and we do not use 
a callback, we miss the exception.
   
   This change modifies the behavior to propagate the 
`FencedInstanceIdException` even if no callback is used. The code is kept very 
similar to the original consumer.
   
   We also change the order - first try to throw the fenced exception, then 
execute callbacks. That is the order in the original consumer so it's safer to 
keep it this way.
   
   For testing, we add a unit test that verifies that the 
`FencedInstanceIdException` is thrown in that case.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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