You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/14 01:56:19 UTC
[GitHub] [pulsar] codelipenghui commented on a change in pull request #14196: [Broker] Change broker producer fence log level
codelipenghui commented on a change in pull request #14196:
URL: https://github.com/apache/pulsar/pull/14196#discussion_r805457388
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -1353,8 +1353,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.getMessage());
+ }
+ } else {
+ log.warn("[{}] Failed to add producer to topic {}: producerId={}, {}",
Review comment:
Should be an error here? It's not expected behavior.
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -1353,8 +1353,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.getMessage());
Review comment:
```suggestion
remoteAddress, topicName, producerId, ex.getCause().getMessage());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org