From f6c59df07ed865a8bdc777db73216347f4882114 Mon Sep 17 00:00:00 2001 From: Yaroslav Klymko Date: Thu, 25 Apr 2019 19:10:42 +0200 Subject: [PATCH] MINOR: Do not log retriable offset commit exceptions as errors (#5904) Reviewers: Jason Gustafson --- .../clients/consumer/internals/ConsumerCoordinator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 64a97ab5d02..68e98ba83e3 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 @@ -823,7 +823,11 @@ public final class ConsumerCoordinator extends AbstractCoordinator { if (error == Errors.NONE) { log.debug("Committed offset {} for partition {}", offset, tp); } else { - log.error("Offset commit failed on partition {} at offset {}: {}", tp, offset, error.message()); + if (error.exception() instanceof RetriableException) { + log.warn("Offset commit failed on partition {} at offset {}: {}", tp, offset, error.message()); + } else { + log.error("Offset commit failed on partition {} at offset {}: {}", tp, offset, error.message()); + } if (error == Errors.GROUP_AUTHORIZATION_FAILED) { future.raise(new GroupAuthorizationException(groupId));