提交 b466b085 编写于 作者: R Rajan Dhabalia 提交者: Matteo Merli

[pulsar-client] Avoid leak on publish failure on batch message (#5442)

上级 62586959
......@@ -468,10 +468,13 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
log.debug("[{}] [{}] Closing out batch to accommodate large message with size {}", topic, producerName,
msg.getDataBuffer().readableBytes());
}
batchMessageAndSend();
batchMessageContainer.add(msg, callback);
lastSendFuture = callback.getFuture();
payload.release();
try {
batchMessageAndSend();
batchMessageContainer.add(msg, callback);
lastSendFuture = callback.getFuture();
} finally {
payload.release();
}
}
private boolean isValidProducerState(SendCallback callback) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册