artemlivshits commented on code in PR #16332:
URL: https://github.com/apache/kafka/pull/16332#discussion_r1645285270
##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -1257,6 +1261,9 @@ public void flush() {
this.sender.wakeup();
try {
this.accumulator.awaitFlushCompletion();
+ if (transactionManager != null) {
+ transactionManager.maybeClearLastError();
Review Comment:
To make it harder to write buggy code by keeping semantics of similar
constructs to be similar. `send + flush + commit` looks like just a more
verbose form for `send + commit` , the latter works without handling errors in
send (correct basic program with minimal effort), the former would swallow the
error.
--
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]