Skip to content

Commit

Permalink
[Broker] Change broker producer fence log level (#14196)
Browse files Browse the repository at this point in the history
(cherry picked from commit 141ea9b)
  • Loading branch information
Demogorgon314 authored and michaeljmarshall committed Feb 23, 2022
1 parent 3f58951 commit 0c3139f
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -1283,8 +1283,15 @@ protected void handleProducer(final CommandProducer cmdProducer) {

producers.remove(producerId, producerFuture);
}).exceptionally(ex -> {
log.error("[{}] Failed to add producer to topic {}: producerId={}, {}",
remoteAddress, topicName, producerId, ex.getMessage());
if (ex.getCause() instanceof BrokerServiceException.ProducerFencedException) {
if (log.isDebugEnabled()) {
log.debug("[{}] Failed to add producer to topic {}: producerId={}, {}",
remoteAddress, topicName, producerId, ex.getCause().getMessage());
}
} else {
log.warn("[{}] Failed to add producer to topic {}: producerId={}, {}",
remoteAddress, topicName, producerId, ex.getCause().getMessage());
}

producer.closeNow(true);
if (producerFuture.completeExceptionally(ex)) {
Expand Down

0 comments on commit 0c3139f

Please sign in to comment.