KAFKA-17648: AsyncKafkaConsumer#unsubscribe swallow TopicAuthorizationException and GroupAuthorizationException
If users subscribe to a topic with invalid name or without permission, they will get some exceptions. Network thread sends MetadataRequest and FindCoordinatorRequest in the background, so there will be some error events in the background queue. When running AsyncKafkaConsumer#close or AsyncKafkaConsumer#unsubscribe, these exceptions should be ignored, or users can't close the consumer successfully.
Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
Yes, it's same. I will close this one.
Hi @kirktrue, after discussing with @m1a2st, this PR will focus metadata error on unsubscribe and close and his PR https://github.com/apache/kafka/pull/17440 will focus on other functions like beginningOffsets, endOffsets, etc. Thank you.
Could you help me review https://github.com/apache/kafka/pull/17199 first? This PR will rely metric to know there is background event, so we can check unsubscribe and close can work when there is metadata error. Thanks.
Hi @lianetm, thanks for review and suggestion. Updated both title and PR description. Thanks.