Skip to content

Commit

Permalink
[Broker] Change broker producer fence log level (apache#14196)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demogorgon314 authored Feb 16, 2022
1 parent 64dc537 commit 141ea9b
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1401,8 +1401,15 @@ private void buildProducerAndAddTopic(Topic topic, long producerId, String produ

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 141ea9b

Please sign in to comment.