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


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -196,6 +196,44 @@ private enum Priority {
         }
     }
 
+    /**
+     * State transitions originate from one of two sources:
+     *
+     * <ol>
+     *     <li><em>External</em> to the transaction manager. For example, the 
user performs an API call on the
+     *         {@link org.apache.kafka.clients.producer.Producer producer} 
that is related to transactional management.
+     *     </li>
+     *     <li><em>Internal</em> to the transaction manager. These transitions 
occur from within the transaction
+     *         manager, for example when handling responses from the broker 
for transactions.
+     *     </li>
+     * </ol>
+     *
+     * When an <em>invalid</em> state transition is attempted, the logic 
related to handling that situation may
+     * differ depending on the source of the state transition. This interface 
allows the caller to provide the desired
+     * logic for handling that invalid state transition attempt as appropriate 
for the situation.
+     *
+     * <p/>
+     *
+     * When the state transition is being attempted on behalf of an 
<em>external</em> source, we want to continue to
+     * throw an {@link IllegalStateException} as this is the existing 
behavior. This gives the user the opportunity
+     * to fix the issue without permanently poisoning the state of the 
transaction manager.
+     *
+     * <p/>
+     *
+     * When the state transition is being attempted on behalf of an 
<em>external</em> source, we want to continue to

Review Comment:
   Yeah, probably. The comment isn't so beautiful now, is it? 😛 



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