kirktrue commented on code in PR #15541:
URL: https://github.com/apache/kafka/pull/15541#discussion_r1529215985


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -270,14 +270,7 @@ public void run() {
         while (!forceClose && transactionManager != null && 
transactionManager.hasOngoingTransaction()) {
             if (!transactionManager.isCompleting()) {
                 log.info("Aborting incomplete transaction due to shutdown");
-
-                try {
-                    // It is possible for the transaction manager to throw 
errors when aborting. Catch these
-                    // so as not to interfere with the rest of the shutdown 
logic.
-                    transactionManager.beginAbort();
-                } catch (Exception e) {
-                    log.error("Error in kafka producer I/O thread while 
aborting transaction: ", e);
-                }
+                transactionManager.beginAbort();

Review Comment:
   @jolshan—setting the local `forceClose` flag to `true` looks like it could 
work. That would certainly prevent the code from repeating this loop.
   
   That flag being set would then trigger the `transactionManager.close()` call 
that occurs after the loop. We'd need to have confidence that the `close()` 
logic doesn't get stuck for similar reasons.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to