This is an automated email from the ASF dual-hosted git repository.
zhaocong pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new b0ad459e19a [improve][broker] Enhance logging for adding schema
failures in ServerCnx (#25048)
b0ad459e19a is described below
commit b0ad459e19a3b47914fa03384098b4f2bf07b5cf
Author: Cong Zhao <[email protected]>
AuthorDate: Mon Jan 5 17:04:12 2026 +0800
[improve][broker] Enhance logging for adding schema failures in ServerCnx
(#25048)
(cherry picked from commit b1019ce54dd3b81cdb2804a5f37c862022132034)
---
.../java/org/apache/pulsar/broker/service/ServerCnx.java | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
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 098c5a9090d..c939059f267 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
@@ -100,6 +100,7 @@ import
org.apache.pulsar.broker.service.persistent.PersistentSubscription;
import org.apache.pulsar.broker.service.persistent.PersistentTopic;
import org.apache.pulsar.broker.service.schema.SchemaRegistryService;
import
org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException;
+import
org.apache.pulsar.broker.service.schema.exceptions.InvalidSchemaDataException;
import org.apache.pulsar.broker.topiclistlimit.TopicListMemoryLimiter;
import org.apache.pulsar.broker.topiclistlimit.TopicListSizeResultCache;
import org.apache.pulsar.broker.web.RestException;
@@ -1730,11 +1731,17 @@ public class ServerCnx extends PulsarHandler implements
TransportCnx {
BrokerServiceException.getClientErrorCode(exception),
message);
}
+
var cause =
FutureUtil.unwrapCompletionException(exception);
- if (!(cause instanceof IncompatibleSchemaException)) {
+ if (cause instanceof IncompatibleSchemaException) {
+ // ignore it
+ } else if (cause instanceof
InvalidSchemaDataException) {
+ log.warn("Try add schema failed due to invalid
schema data, "
+ + "remote address {}, topic {}, producerId
{}",
+ remoteAddress, topicName, producerId);
+ } else {
log.error("Try add schema failed, remote address
{}, topic {}, producerId {}",
- remoteAddress,
- topicName, producerId, exception);
+ remoteAddress, topicName, producerId, exception);
}
producers.remove(producerId, producerFuture);
return null;