kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-2221: Log the real exception which triggered a reconnect
Date Fri, 29 Jan 2016 04:25:12 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.9.0 d4055ca5c -> d5ba34a79

KAFKA-2221: Log the real exception which triggered a reconnect

The commit here improves the logging in SimpleConsumer to log the real reason why a reconnect
was attempted. Relates to https://issues.apache.org/jira/browse/KAFKA-2221.

The same patch was submitted a while back but wasn't merged because SimpleConsumer was considered
deprecated and users' aren't expected to use it. However, more and more users in the user
mailing list are running into this log message but have no way to understand what the root
cause is. So IMO, this change still adds value  to such users who are using SimpleConsumer.

Author: Jaikiran Pai <jaikiran.pai@gmail.com>

Reviewers: Jiangjie Qin, Ismael Juma, Guozhang Wang

Closes #138 from jaikiran/kafka-2221

(cherry picked from commit 8e8b9cadea0715882997bd5d1641a065f3997077)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>

Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/d5ba34a7
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/d5ba34a7
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/d5ba34a7

Branch: refs/heads/0.9.0
Commit: d5ba34a79b3585c9e5868d69346462405019fb80
Parents: d4055ca
Author: Jaikiran Pai <jaikiran.pai@gmail.com>
Authored: Thu Jan 28 20:24:58 2016 -0800
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Thu Jan 28 20:25:08 2016 -0800

 core/src/main/scala/kafka/consumer/SimpleConsumer.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/scala/kafka/consumer/SimpleConsumer.scala b/core/src/main/scala/kafka/consumer/SimpleConsumer.scala
index e15aca4..e315678 100644
--- a/core/src/main/scala/kafka/consumer/SimpleConsumer.scala
+++ b/core/src/main/scala/kafka/consumer/SimpleConsumer.scala
@@ -91,7 +91,7 @@ class SimpleConsumer(val host: String,
         case e: AsynchronousCloseException =>
           throw e
         case e : Throwable =>
-          info("Reconnect due to socket error: %s".format(e.toString))
+          info("Reconnect due to error:", e)
           // retry once
           try {

View raw message