You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/09/20 17:24:28 UTC
Re: [PR] Implement multi-level Kafka admin client reuse for optimal performance [pinot]
Copilot commented on code in PR #16620:
URL: https://github.com/apache/pinot/pull/16620#discussion_r2365727384
##########
pinot-plugins/pinot-stream-ingestion/pinot-kafka-2.0/src/main/java/org/apache/pinot/plugin/stream/kafka20/KafkaStreamMetadataProvider.java:
##########
@@ -173,7 +173,8 @@ public Map<String, PartitionLagState> getCurrentPartitionLagState(
@Override
public List<TopicMetadata> getTopics() {
- try (AdminClient adminClient = createAdminClient()) {
+ try {
Review Comment:
The `getTopics()` method removes the try-with-resources pattern but doesn't handle admin client cleanup. Since the shared admin client is obtained but never explicitly closed in this method, consider documenting that cleanup is handled by the reference counting mechanism or ensure proper resource management.
```suggestion
try {
// The AdminClient instance is a shared resource managed by a reference counting mechanism.
// Cleanup of the AdminClient is handled elsewhere; do not close it here.
```
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org