kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-5052; Don't pass underlying internal exception to RetriableCommitFailedException
Date Tue, 11 Apr 2017 00:21:20 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk c31958eb0 -> 749e9e14c


KAFKA-5052; Don't pass underlying internal exception to RetriableCommitFailedException

Author: Apurva Mehta <apurva@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #2838 from apurvam/KAFKA-5052-dont-send-uderlying-exception-to-retriableoffsetcommitfailed


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

Branch: refs/heads/trunk
Commit: 749e9e14c7a1b8a97f79a2d852d8c8647b55b38e
Parents: c31958e
Author: Apurva Mehta <apurva@confluent.io>
Authored: Tue Apr 11 01:21:07 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Tue Apr 11 01:21:07 2017 +0100

----------------------------------------------------------------------
 .../kafka/clients/consumer/RetriableCommitFailedException.java   | 2 +-
 .../kafka/clients/consumer/internals/ConsumerCoordinator.java    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/749e9e14/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java
b/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java
index 33cba6f..510362a 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java
@@ -27,7 +27,7 @@ public class RetriableCommitFailedException extends RetriableException {
     }
 
     public RetriableCommitFailedException(String message) {
-        super(message);
+        super("Offset commit failed with a retriable exception. You should retry committing
offsets. The underlying error was: " + message);
     }
 
     public RetriableCommitFailedException(String message, Throwable t) {

http://git-wip-us.apache.org/repos/asf/kafka/blob/749e9e14/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
index fa2e31a..7d21767 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
@@ -521,7 +521,7 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
                 @Override
                 public void onFailure(RuntimeException e) {
                     pendingAsyncCommits.decrementAndGet();
-                    completedOffsetCommits.add(new OffsetCommitCompletion(callback, offsets,
new RetriableCommitFailedException(e)));
+                    completedOffsetCommits.add(new OffsetCommitCompletion(callback, offsets,
new RetriableCommitFailedException(e.getMessage())));
                 }
             });
         }
@@ -550,7 +550,7 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
                 Exception commitException = e;
 
                 if (e instanceof RetriableException)
-                    commitException = new RetriableCommitFailedException(e);
+                    commitException = new RetriableCommitFailedException(e.getMessage());
 
                 completedOffsetCommits.add(new OffsetCommitCompletion(cb, offsets, commitException));
             }


Mime
View raw message