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


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -968,13 +968,31 @@ private void transitionTo(State target) {
     }
 
     private void transitionTo(State target, RuntimeException error) {
+        transitionTo(target, error, false);

Review Comment:
   > I think masking the ApiException is better than silently transitioning 
into fatal state - if transitionToAbortableError tries going into abortable 
state, that ApiException is probably something that the calling code can 
handle, and try to recover by aborting. If we still throw that exception, but 
in reality the internal state is fatal already, that is a violation of the API, 
isn't it?
   
   I've updated the code to throw the exception in this case, as you'd 
suggested.



##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -266,7 +266,7 @@ public synchronized TransactionalRequestResult beginAbort() 
{
         return handleCachedTransactionRequestResult(() -> {
             if (currentState != State.ABORTABLE_ERROR)
                 maybeFailWithError();
-            transitionTo(State.ABORTING_TRANSACTION);
+            transitionTo(State.ABORTING_TRANSACTION, null, true);

Review Comment:
   Fixed.



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