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/05/16 18:35:56 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_r874042264


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -1292,8 +1292,10 @@ 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.warn("Retrying upon missing initProducerId due to cluster authorization error");
+                reenqueue();

Review Comment:
   Hmm, I think we do want the error to get propagated back to the application. Most users would expect the application to fail so that they have a chance to see the issue and fix it. High level, what I was thinking we could do is fail the request by calling `result.fail`, then transition back to `UNINITIALIZED`. Then if the user wants to, they can call `initTransactions()` to retry.



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