turcsanyip commented on code in PR #10538:
URL: https://github.com/apache/nifi/pull/10538#discussion_r2610352547


##########
nifi-extension-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/kafka/processors/ConsumeKafka.java:
##########
@@ -502,6 +604,11 @@ private void close(final KafkaConsumerService 
consumerService, final String reas
         try {
             consumerService.close();
             activeConsumerCount.decrementAndGet();
+
+            final PollingContext partitionedPollingContext = 
consumerServiceToPartitionedPollingContext.remove(consumerService);
+            if (partitionedPollingContext != null) {
+                
availablePartitionedPollingContexts.add(partitionedPollingContext);
+            }

Review Comment:
   When closing the consumer, the unowned `PollingContext` should be returned 
to the pool in a `finally` block to ensure it will not be lost if an exception 
occurs during close.



-- 
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]

Reply via email to