You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ba...@apache.org on 2025/02/06 11:36:29 UTC
(pulsar) branch branch-3.3 updated: [improve][client] Avoid logging errors for retriable errors when creating producer (#23935)
This is an automated email from the ASF dual-hosted git repository.
baodi pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.3 by this push:
new 74875cf14a2 [improve][client] Avoid logging errors for retriable errors when creating producer (#23935)
74875cf14a2 is described below
commit 74875cf14a2a2a88c0b9cd2c908d9b2d0ccf63c0
Author: Baodi Shi <ba...@apache.org>
AuthorDate: Thu Feb 6 18:52:08 2025 +0800
[improve][client] Avoid logging errors for retriable errors when creating producer (#23935)
(cherry picked from commit a19eaa2b972ab8fe1a2a45e65df1566cf28fb336)
---
.../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 d34902a7bda..ca03ba4530d 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
@@ -1908,14 +1908,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) -> {
@@ -1927,6 +1919,7 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
future.complete(null);
return null;
}
+
if (cause instanceof PulsarClientException.ProducerBlockedQuotaExceededException) {
synchronized (this) {
log.warn("[{}] [{}] Topic backlog quota exceeded. Throwing Exception on producer.", topic,
@@ -1945,6 +1938,10 @@ 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) {