fapaul commented on code in PR #159:
URL: 
https://github.com/apache/flink-connector-kafka/pull/159#discussion_r2020662422


##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/sink/internal/ProducerPoolImpl.java:
##########
@@ -131,26 +131,33 @@ public void recycleByTransactionId(String 
transactionalId) {
         if (!earlierTransactions.isEmpty()) {
             for (String id : earlierTransactions.values()) {
                 ProducerEntry entry = producerByTransactionalId.remove(id);
-                recycleProducer(entry.getProducer());
+                recycleProducer(entry.getProducer(), false);
             }
             earlierTransactions.clear();
         }
     }
 
     @Override
     public void recycle(FlinkKafkaInternalProducer<byte[], byte[]> producer) {
-        recycleProducer(producer);
+        recycleProducer(producer, true);
         ProducerEntry producerEntry =
                 
producerByTransactionalId.remove(producer.getTransactionalId());
         
transactionalIdsByCheckpoint.remove(producerEntry.getCheckpointedTransaction());
     }
 
-    private void recycleProducer(@Nullable FlinkKafkaInternalProducer<byte[], 
byte[]> producer) {
+    private void recycleProducer(

Review Comment:
   Nit: Maybe it makes sense to handle the success criteria 
`recycleByTransactionId` and do not call `recyleProducer` at all if the 
transaction wasn't finished successfully.
   
   It removes the additional changes that are only caused by the signature 
change.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to