merlimat commented on a change in pull request #2471: Pulsar Java Client Interceptors. URL: https://github.com/apache/incubator-pulsar/pull/2471#discussion_r213785810
########## File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java ########## @@ -231,21 +234,30 @@ public SendCallback getNextSendCallback() { public void sendComplete(Exception e) { if (e != null) { stats.incrementSendFailed(); + onSendAcknowledgement(interceptorMessage, null, e); future.completeExceptionally(e); } else { - future.complete(message.getMessageId()); + onSendAcknowledgement(interceptorMessage, interceptorMessage.getMessageId(), null); + future.complete(interceptorMessage.getMessageId()); stats.incrementNumAcksReceived(System.nanoTime() - createdAt); } + interceptorMessage.getDataBuffer().release(); Review comment: It would be good to have try/finally block to ensure release is called when any exception is thrown ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services