lifepuzzlefun commented on code in PR #20568:
URL: https://github.com/apache/pulsar/pull/20568#discussion_r1231050918


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:
##########
@@ -361,6 +361,15 @@ public Future<Void> sendMessages(final List<? extends 
Entry> entries, EntryBatch
                 msgOutCounter.add(totalMessages);
                 bytesOutCounter.add(totalBytes);
                 chunkedMessageRate.recordMultipleEvents(totalChunkedMessages, 
0);
+            } else {
+                log.warn("[{}-{}] Sent messages to client fail by IO 
exception[{}], these messages(messages count:"
+                                + " {}) will be redelivered after the 
heartbeat check fails. If the next heartbeat"
+                                + " check is successful, these messages will 
be stuck until the client reconnect"
+                                + " or the topic is reloaded. Consumer: {}",
+                        topicName, subscription, status.cause() == null ? "" : 
status.cause().getMessage(),
+                        totalMessages, this.toString(), status.cause());
+                // If the health check fail, this connection will be closed.
+                cnx.healthCheckManually();

Review Comment:
   I notice there is a recent added code also check the connection liveness. do 
you think we can reuse this method ? 
   see 
https://github.com/apache/pulsar/blob/d85736cbbb6bdac8ec9f1264df479f671434350f/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L3395-L3418
 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to