gunli commented on code in PR #1055:
URL: https://github.com/apache/pulsar-client-go/pull/1055#discussion_r1261917963
##########
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:
The final solution is encapsulating the resource releasing logic in
request.done(), anywhere there is an error, just call request.done()
--
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]