This is an automated email from the ASF dual-hosted git repository.

baodi pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new df737f7e882 Cherry-pick #23935
df737f7e882 is described below

commit df737f7e882408148e55f5836b903639f99f962b
Author: Baodi Shi <[email protected]>
AuthorDate: Thu Feb 6 19:42:09 2025 +0800

    Cherry-pick #23935
---
 .../java/org/apache/pulsar/client/impl/ProducerImpl.java    | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 50209c009c7..6fd47e072f0 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -1836,14 +1836,6 @@ public class ProducerImpl<T> extends ProducerBase<T> 
implements TimerTask, Conne
                         cnx.sendRequestWithId(cmd, closeRequestId);
                     }
 
-                    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 exist.
                     if (cause instanceof 
PulsarClientException.TopicDoesNotExistException) {
                         closeAsync().whenComplete((v, ex) -> {
@@ -1873,6 +1865,11 @@ public class ProducerImpl<T> extends ProducerBase<T> 
implements TimerTask, Conne
                     } else if (cause instanceof 
PulsarClientException.ProducerBlockedQuotaExceededError) {
                         log.warn("[{}] [{}] Producer is blocked on creation 
because backlog exceeded on topic.",
                                 producerName, topic);
+                    } else if (PulsarClientException.isRetriableError(cause)) {
+                        log.info("[{}] [{}] Temporary error in creating 
producer: {}", topic,
+                                producerName, cause.getMessage());
+                    } else {
+                        log.error("[{}] [{}] Failed to create producer: {}", 
topic, producerName, cause.getMessage());
                     }
 
                     if (cause instanceof 
PulsarClientException.TopicTerminatedException) {

Reply via email to