You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/06/17 22:04:35 UTC

[GitHub] [kafka] hachikuji commented on a diff in pull request #12149: KAFKA-13668: Retry upon missing initProducerId due to authorization error

hachikuji commented on code in PR #12149:
URL: https://github.com/apache/kafka/pull/12149#discussion_r900524288


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -1292,8 +1296,12 @@ public void handleResponse(AbstractResponse response) {
                 reenqueue();
             } else if (error == Errors.COORDINATOR_LOAD_IN_PROGRESS || error == Errors.CONCURRENT_TRANSACTIONS) {
                 reenqueue();
-            } else if (error == Errors.TRANSACTIONAL_ID_AUTHORIZATION_FAILED ||
-                    error == Errors.CLUSTER_AUTHORIZATION_FAILED) {
+            } else if (error == Errors.CLUSTER_AUTHORIZATION_FAILED) {
+                log.error("Cluster authorization failure, transition the producer state back to uninitialized");
+                fail(error.exception());
+                // transition back to uninitialized state to enable client side retry
+                transitionTo(State.UNINITIALIZED);
+            } else if (error == Errors.TRANSACTIONAL_ID_AUTHORIZATION_FAILED) {

Review Comment:
   I wonder if we should handle this case consistently. I cannot think of any reason not to.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org