You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/28 06:56:12 UTC
[GitHub] [pulsar] Shoothzj commented on a diff in pull request #16835: Forget to update memory usage when invalid message
Shoothzj commented on code in PR #16835:
URL: https://github.com/apache/pulsar/pull/16835#discussion_r931846522
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BatchMessageContainerImpl.java:
##########
@@ -199,6 +199,7 @@ public boolean isMultiBatches() {
public OpSendMsg createOpSendMsg() throws IOException {
ByteBuf encryptedPayload = producer.encryptMessage(messageMetadata, getCompressedBatchMetadataAndPayload());
if (encryptedPayload.readableBytes() > ClientCnx.getMaxMessageSize()) {
+ messages.forEach(msg -> producer.client.getMemoryLimitController().releaseMemory(msg.getUncompressedSize()));
Review Comment:
@gaozhangmin no need to release semaphore. I have created a testcase to cover this.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org