kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-17648: AsyncKafkaConsumer#unsubscribe swallow TopicAuthorizationException and GroupAuthorizationException

Open FrankYang0529 opened this issue 1 year ago • 2 comments

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)

FrankYang0529 avatar Oct 16 '24 13:10 FrankYang0529

Yes, it's same. I will close this one.

FrankYang0529 avatar Oct 18 '24 04:10 FrankYang0529

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.

FrankYang0529 avatar Oct 20 '24 02:10 FrankYang0529

Hi @lianetm, thanks for review and suggestion. Updated both title and PR description. Thanks.

FrankYang0529 avatar Nov 15 '24 02:11 FrankYang0529