mjsax commented on code in PR #16332:
URL: https://github.com/apache/kafka/pull/16332#discussion_r1638861356


##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -792,6 +792,9 @@ public void sendOffsetsToTransaction(Map<TopicPartition, 
OffsetAndMetadata> offs
      * <p>
      * Further, if any of the {@link #send(ProducerRecord)} calls which were 
part of the transaction hit irrecoverable
      * errors, this method will throw the last received exception immediately 
and the transaction will not be committed.
+     * It should be noted that if <code>flush()</code> is called explicitly 
beforehand, this method will NOT throw any

Review Comment:
   ```suggestion
        * It should be noted that if {@link #flush()} is called explicitly 
beforehand, this method will NOT throw any
   ```



##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -1220,6 +1223,7 @@ private void ensureValidRecordSize(int size) {
      * of <code>flush()</code> is that any previously sent record will have 
completed (e.g. <code>Future.isDone() == true</code>).
      * A request is considered completed when it is successfully acknowledged
      * according to the <code>acks</code> configuration you have specified or 
else it results in an error.
+     * Additionally, this method clears the last exception in the transaction 
and returns the transaction from the error state.

Review Comment:
   > returns
   
   Same question as above



##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -792,6 +792,9 @@ public void sendOffsetsToTransaction(Map<TopicPartition, 
OffsetAndMetadata> offs
      * <p>
      * Further, if any of the {@link #send(ProducerRecord)} calls which were 
part of the transaction hit irrecoverable
      * errors, this method will throw the last received exception immediately 
and the transaction will not be committed.
+     * It should be noted that if <code>flush()</code> is called explicitly 
beforehand, this method will NOT throw any
+     * exception related to the {@link #send(ProducerRecord)} calls. Since 
<code>flush()</code> clears the last received

Review Comment:
   ```suggestion
        * exception related to the {@link #send(ProducerRecord)} calls. Since 
{@link #flush()} clears the last received
   ```



##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -792,6 +792,9 @@ public void sendOffsetsToTransaction(Map<TopicPartition, 
OffsetAndMetadata> offs
      * <p>
      * Further, if any of the {@link #send(ProducerRecord)} calls which were 
part of the transaction hit irrecoverable
      * errors, this method will throw the last received exception immediately 
and the transaction will not be committed.
+     * It should be noted that if <code>flush()</code> is called explicitly 
beforehand, this method will NOT throw any
+     * exception related to the {@link #send(ProducerRecord)} calls. Since 
<code>flush()</code> clears the last received
+     * exception and returns the transaction from the error state.

Review Comment:
   > returns the transaction from the error state.
   
   The word "returns" is confusing to me -- but I am not a native speaker. 
Should it be "and transits the transaction out of any error state"



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