You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by mj...@apache.org on 2018/06/25 15:49:13 UTC

[kafka] branch trunk updated: Minor: add exception to debug log for Sender#maybeSendTransactionalRequest (#5282)

This is an automated email from the ASF dual-hosted git repository.

mjsax pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2f36da1  Minor: add exception to debug log for Sender#maybeSendTransactionalRequest (#5282)
2f36da1 is described below

commit 2f36da1747e62a21108e21edacaf2e5ef12c2d6a
Author: tedyu <yu...@gmail.com>
AuthorDate: Mon Jun 25 08:49:01 2018 -0700

    Minor: add exception to debug log for Sender#maybeSendTransactionalRequest (#5282)
    
    Reviewer: Ismael Juma <is...@confluent.io>, Matthias J. Sax <ma...@confluent.io>
---
 .../java/org/apache/kafka/clients/producer/internals/Sender.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java b/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
index 5cb9046..d1a7bc9 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
@@ -364,7 +364,7 @@ public class Sender implements Runnable {
                 }
             } catch (IOException e) {
                 log.debug("Disconnect from {} while trying to send request {}. Going " +
-                        "to back off and retry", targetNode, requestBuilder);
+                        "to back off and retry.", targetNode, requestBuilder, e);
                 if (nextRequestHandler.needsCoordinator()) {
                     // We break here so that we pick up the FindCoordinator request immediately.
                     transactionManager.lookupCoordinator(nextRequestHandler);
@@ -423,8 +423,9 @@ public class Sender implements Runnable {
 
     private void maybeWaitForProducerId() {
         while (!transactionManager.hasProducerId() && !transactionManager.hasError()) {
+            Node node = null;
             try {
-                Node node = awaitLeastLoadedNodeReady(requestTimeoutMs);
+                node = awaitLeastLoadedNodeReady(requestTimeoutMs);
                 if (node != null) {
                     ClientResponse response = sendAndAwaitInitProducerIdRequest(node);
                     InitProducerIdResponse initProducerIdResponse = (InitProducerIdResponse) response.responseBody();
@@ -448,7 +449,7 @@ public class Sender implements Runnable {
                 transactionManager.transitionToFatalError(e);
                 break;
             } catch (IOException e) {
-                log.debug("Broker {} disconnected while awaiting InitProducerId response", e);
+                log.debug("Broker {} disconnected while awaiting InitProducerId response", node, e);
             }
             log.trace("Retry InitProducerIdRequest in {}ms.", retryBackoffMs);
             time.sleep(retryBackoffMs);