You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by zi...@apache.org on 2025/02/07 03:49:05 UTC
(pulsar) 01/04: [improve][broker] Don't print error logs for ProducerBusyException (#23929)
This is an automated email from the ASF dual-hosted git repository.
zike pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 0612506e4545c03518a9b3c9d320af5fbe3df439
Author: Zike Yang <zi...@apache.org>
AuthorDate: Thu Feb 6 10:07:16 2025 +0800
[improve][broker] Don't print error logs for ProducerBusyException (#23929)
### Motivation
When the producer's maximum count is reached, the broker will log the following error message:
```
2025-02-05T18:31:37,996+0800 [pulsar-io-18-16] ERROR org.apache.pulsar.broker.service.ServerCnx - [/127.0.0.1:57684] Failed to create topic persistent://public/default/test2asgasgaw, producerId=1
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.BrokerServiceException$ProducerBusyException: Topic 'persistent://public/default/test2asgasgaw' reached max producers limit
```
These errors are related to the client side. The client can handle the error, so we don't need to print it in the broker log.
### Modifications
- Avoid printing the error log for the ProducerBusyException
(cherry picked from commit 144fe2eb634471d338a7e6ee879bc6175e5d061c)
---
.../src/main/java/org/apache/pulsar/broker/service/ServerCnx.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
index 8be363171df..27e0b0469b9 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
@@ -1730,7 +1730,8 @@ public class ServerCnx extends PulsarHandler implements TransportCnx {
log.warn("[{}] Failed to load topic {}, producerId={}: Topic not found", remoteAddress, topicName,
producerId);
} else if (!Exceptions.areExceptionsPresentInChain(cause,
- ServiceUnitNotReadyException.class, ManagedLedgerException.class)) {
+ ServiceUnitNotReadyException.class, ManagedLedgerException.class,
+ BrokerServiceException.ProducerBusyException.class)) {
log.error("[{}] Failed to create topic {}, producerId={}",
remoteAddress, topicName, producerId, exception);
}