akatona84 commented on code in PR #12392:
URL: https://github.com/apache/kafka/pull/12392#discussion_r923072806


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -728,18 +779,11 @@ synchronized void maybeResolveSequences() {
                 } else {
                     // We would enter this branch if all in flight batches 
were ultimately expired in the producer.
                     if (isTransactional()) {
-                        // For the transactional producer, we bump the epoch 
if possible, otherwise we transition to a fatal error
+                        // For the transactional producer, we bump the epoch 
if possible, then transition to a fatal error

Review Comment:
   It's a behaviour change here, when the transactional producer reaches this 
state, we'll do an epoch bump and then it'll be a fatal error.
   Could you explain how it's changed actually? What's the difference between 
flipping the epochBumpRequired flag and go to abortable, and going to 
fatalbumpable?
   Was the producer still usable after abortable transition (and the handled 
abort)? 



##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -241,12 +246,39 @@ synchronized TransactionalRequestResult 
initializeTransactions(ProducerIdAndEpoc
                     .setProducerId(producerIdAndEpoch.producerId)
                     .setProducerEpoch(producerIdAndEpoch.epoch);
             InitProducerIdHandler handler = new InitProducerIdHandler(new 
InitProducerIdRequest.Builder(requestData),
-                    isEpochBump);
+                    isEpochBump, false);
             enqueueRequest(handler);
             return handler.result;
         }, State.INITIALIZING, "initTransactions");
     }
 
+    synchronized void tryTransitioningIntoFatalBumpableError(RuntimeException 
cause) {
+        if (currentState == State.FATAL_ERROR || currentState == 
State.FATAL_BUMPABLE_ERROR) {
+            // Already in a fatal state, skip
+            return;
+        }
+        RuntimeException failure = cause == null
+                ? new KafkaException("Encountered unrecoverable error due to 
batch delivery timeout")
+                : new KafkaException("Encountered unrecoverable error due to 
batch delivery timeout", cause);

Review Comment:
   It can be another timeout exception too (e.g. upon request timeout?)
   



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