becketqin commented on a change in pull request #9287: [FLINK-13498][kafka] 
abort transactions in parallel
URL: https://github.com/apache/flink/pull/9287#discussion_r309531322
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer011.java
 ##########
 @@ -906,11 +907,33 @@ private void 
resetAvailableTransactionalIdsPool(Collection<String> transactional
        // ----------------------------------- Utilities 
--------------------------
 
        private void abortTransactions(Set<String> transactionalIds) {
-               for (String transactionalId : transactionalIds) {
-                       try (FlinkKafkaProducer<byte[], byte[]> kafkaProducer =
-                                       
initTransactionalProducer(transactionalId, false)) {
-                               // it suffice to call initTransactions - this 
will abort any lingering transactions
-                               kafkaProducer.initTransactions();
+               // shortcut for non-exactly-once producers
+               if (transactionalIds.isEmpty()) {
+                       return;
+               }
+
+               ForkJoinPool forkJoinPool = null;
+               try {
+                       // limit the number of connections to the number that 
is used during runtime
 
 Review comment:
   I would not concern too much about the load on the Kafka brokers. They are 
designed to accept thousands of requests per second. And committing / aborting 
the transactions in Kafka is pretty much just like send an ordinary message. So 
it is probably OK.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to