kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject kafka git commit: KAFKA-2585; ConsoleConsumer should not hang infinitely upon exception
Date Mon, 28 Sep 2015 21:41:28 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk c7bc5366d -> 41afdbe68


KAFKA-2585; ConsoleConsumer should not hang infinitely upon exception

Author: Dong Lin <lindong28@gmail.com>

Reviewers: Ismael Juma, Onur Karaman, Gwen Shapira

Closes #247 from lindong28/KAFKA-2585


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

Branch: refs/heads/trunk
Commit: 41afdbe680c73621c309280a307e1f60b330905e
Parents: c7bc536
Author: Dong Lin <lindong28@gmail.com>
Authored: Mon Sep 28 14:41:18 2015 -0700
Committer: Gwen Shapira <cshapi@gmail.com>
Committed: Mon Sep 28 14:41:18 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/ConsoleConsumer.scala | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/41afdbe6/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/ConsoleConsumer.scala b/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
index a9c5427..de4900d 100755
--- a/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
+++ b/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
@@ -38,7 +38,13 @@ object ConsoleConsumer extends Logging {
 
   def main(args: Array[String]) {
     val conf = new ConsumerConfig(args)
-    run(conf)
+    try {
+      run(conf)
+    } catch {
+      case e: Throwable =>
+        error("Unknown error when running consumer: ", e)
+        System.exit(1);
+    }
   }
 
   def run(conf: ConsumerConfig) {


Mime
View raw message