You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ezhou413 (via GitHub)" <gi...@apache.org> on 2026/09/21 22:25:29 UTC

[PR] KAFKA-20237: Stuck transaction manager after ssl handshake failure [kafka]

ezhou413 opened a new pull request, #23547:
URL: https://github.com/apache/kafka/pull/23547

   Fixes Producer initialization getting stuck after an auth error by failing current active request


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


Re: [PR] KAFKA-20237: Stuck transaction manager after ssl handshake failure [kafka]

Posted by "muralibasani (via GitHub)" <gi...@apache.org>.
muralibasani commented on code in PR #23547:
URL: https://github.com/apache/kafka/pull/23547#discussion_r4097249986


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:
##########
@@ -965,8 +965,16 @@ synchronized void retry(TxnRequestHandler request) {
     }
 
     synchronized void authenticationFailed(AuthenticationException e) {
+        // An idempotent producer only sends InitProducerId, which is left pending so that it is retried
+        // once the connection recovers or against another node. This matches the produce path, where an
+        // authentication failure only fails the affected batches.
+        if (!isTransactional() || pendingRequests.isEmpty())
+            return;
+
         for (TxnRequestHandler request : pendingRequests)
-            request.fatalError(e);
+            request.fail(e);

Review Comment:
   now that txn request is failing, a test would be better ? and with multiple pending requests ?



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


Re: [PR] KAFKA-20237: Stuck transaction manager after ssl handshake failure [kafka]

Posted by "muralibasani (via GitHub)" <gi...@apache.org>.
muralibasani commented on code in PR #23547:
URL: https://github.com/apache/kafka/pull/23547#discussion_r4097237117


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -509,12 +509,22 @@ private boolean maybeSendAndPollTransactionalRequest() {
             transactionManager.setInFlightCorrelationId(clientRequest.correlationId());
             client.poll(retryBackoffMs, time.milliseconds());
             return true;
+        } catch (AuthenticationException e) {
+            // The handler has already been removed from the pending queue. Put it back so that
+            // TransactionManager#authenticationFailed handles it along with any other pending requests.
+            transactionManager.retry(nextRequestHandler);
+            throw e;
         } catch (IOException e) {
             log.debug("Disconnect from {} while trying to send request {}. Going " +
                     "to back off and retry.", targetNode, requestBuilder, e);
             // We break here so that we pick up the FindCoordinator request immediately.
             maybeFindCoordinatorAndRetry(nextRequestHandler);
             return true;
+        } catch (RuntimeException e) {

Review Comment:
   this is too broad and treats all requests as fatal.



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