Gleiphir2769 commented on code in PR #1055:
URL: https://github.com/apache/pulsar-client-go/pull/1055#discussion_r1261910342
##########
pulsar/producer_partition.go:
##########
@@ -542,6 +538,11 @@ func (p *partitionProducer) internalSend(request
*sendRequest) {
uncompressedSize := len(uncompressedPayload)
+ // try to reserve memory for uncompressedPayload
+ if !p.canReserveMem(request, int64(uncompressedSize)) {
+ return
Review Comment:
And I think Semaphore released by `canReserveMem ` may not be a good idea.
It makes `canReserveMem` must be invoked after `canAddToQueue `. What do you
think?
--
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]