storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptgo...@apache.org
Subject [1/7] storm git commit: STORM-693: when bolt fails to write tuple, it should report error instead of silently acking.
Date Wed, 18 Mar 2015 15:28:29 GMT
Repository: storm
Updated Branches:
  refs/heads/0.9.3-branch 6b06d8468 -> b1bbacb71


STORM-693: when bolt fails to write tuple, it should report error instead of silently acking.

Signed-off-by: P. Taylor Goetz <ptgoetz@gmail.com>


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

Branch: refs/heads/0.9.3-branch
Commit: e63fb2af9086e2b2e688662ca42a4b4d0112274b
Parents: 6b06d84
Author: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Authored: Mon Mar 2 16:06:58 2015 -0800
Committer: P. Taylor Goetz <ptgoetz@gmail.com>
Committed: Wed Mar 18 10:58:55 2015 -0400

----------------------------------------------------------------------
 external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java  | 7 +++----
 .../storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java  | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/e63fb2af/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index b6c3de4..cf169dc 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -101,11 +101,10 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
             } else {
                 LOG.warn("skipping key = " + key + ", topic selector returned null.");
             }
-        } catch (Exception ex) {
-            LOG.error("Could not send message with key = " + key
-                    + " and value = " + message + " to topic = " + topic, ex);
-        } finally {
             collector.ack(input);
+        } catch (Exception ex) {
+            collector.reportError(ex);
+            collector.fail(input);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/storm/blob/e63fb2af/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java b/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
index 2a56f84..c30cba1 100644
--- a/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
+++ b/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
@@ -143,7 +143,7 @@ public class KafkaBoltTest {
         String message = "value-234";
         Tuple tuple = generateTestTuple(message);
         bolt.execute(tuple);
-        verify(collector).ack(tuple);
+        verify(collector).fail(tuple);
     }
 
 


Mime
View raw message