Skip to content

Commit

Permalink
Change the producer fence error log to debug level (apache#12447)
Browse files Browse the repository at this point in the history
  • Loading branch information
codelipenghui authored Oct 21, 2021
1 parent af0ea69 commit 64c4419
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,14 @@ public void connectionOpened(final ClientCnx cnx) {
cnx.channel().close();
return null;
}
log.error("[{}] [{}] Failed to create producer: {}", topic, producerName, cause.getMessage());
if (cause instanceof PulsarClientException.ProducerFencedException) {
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] Failed to create producer: {}",
topic, producerName, cause.getMessage());
}
} else {
log.error("[{}] [{}] Failed to create producer: {}", topic, producerName, cause.getMessage());
}
// Close the producer since topic does not exists.
if (cause instanceof PulsarClientException.TopicDoesNotExistException) {
closeAsync().whenComplete((v, ex) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ public static Producer<byte[]> createExclusiveProducerWithRetry(PulsarClient cli
}
tries++;
if (tries % 6 == 0) {
log.warn("Failed to acquire exclusive producer to topic {} after {} attempts. Will retry if we are still the leader.", topic, tries);
if (log.isDebugEnabled()) {
log.debug("Failed to acquire exclusive producer to topic {} after {} attempts. Will retry if we are still the leader.", topic, tries);
}
}
Thread.sleep(sleepInBetweenMs);
} while (isLeader.get());
Expand Down

0 comments on commit 64c4419

Please sign in to comment.