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 <[email protected]>
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);
                 }

Reply via email to