poorbarcode commented on code in PR #22393:
URL: https://github.com/apache/pulsar/pull/22393#discussion_r1548017855


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:
##########
@@ -418,16 +419,14 @@ public void sendComplete(Exception e) {
                         stats.incrementNumAcksReceived(latencyNanos);
                     }
                 } finally {
-                    interceptorMessage.getDataBuffer().release();
+                    ReferenceCountUtil.safeRelease(payloadInCurrentMsg);

Review Comment:
   > Maybe we can calculate the metric once time for one batch.
   
   Good suggestion. I think calculating for every single message is better, the 
metrics `publish latency` will be more precise when users set 
`batchingMaxPublishDelay` to a large value.



-- 
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