appchemist commented on PR #15961: URL: https://github.com/apache/kafka/pull/15961#issuecomment-2136860702
To summarize, the locations where Metadata Errors can be handled, it seems like three main options exist: - `ConsumerNetworkThread` - `NetworkClientDelegate` - `KafkaClient` - I think we all agree that the location is too deep and low-level for handling Metadata Errors. ### When handled by `NetworkClientDelegate` For legacy Consumers, `ConsumerNetworkClient.poll` is propagating the error. For new Consumers, `NetworkClientDelegate` appears to provide high-level access to `KafkaClient`, like `ConsumerNetworkClient`. From this perspective, handling Metadata Errors in `NetworkClientDelegate.poll` can be considered analogous to the approach in the legacy Consumer. Since both legacy and new Consumers handle error at the same level, this is considered an expected location. I think that's what the people who commented about handling it here were focusing on. What do you think? @philipnee ### When handled by `ConsumerNetworkThread` Handling in `NetworkClientDelegate.poll` is called inside `ConsumerNetworkThread.runOnce`, which hides the intention of error propagation. Also, it adds the responsibility of propagating metadata errors to the existing responsibility of interfacing with the `NetworkClient`. But `ConsumerNetworkThread.runOnce` is explicitly defines and runs a background thread task. So There is an opinion that create Metadata Error Manager in `ConsumerNetworkThread` level. What do you think? @lianetm & @kirktrue ### My Opinion My suggestion would be to add a `RequestManager` for Metadata Error in `ConsumerNetworkThread` level. This is because the `NetworkClientDelegate` focused solely on interfacing with the network client and handling errors within `ConsumerNetworkThread`. Please let me know if I've misunderstood anything -- 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