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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to