michaeljmarshall commented on a change in pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906#discussion_r701598472



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -907,6 +908,7 @@ protected WriteInEventLoopCallback 
newObject(Handle<WriteInEventLoopCallback> ha
                     log.info("[{}] [{}] Closed Producer", topic, producerName);
                     setState(State.Closed);
                     pendingMessages.forEach(msg -> {
+                        
client.getMemoryLimitController().releaseMemory(msg.uncompressedSize);

Review comment:
       Do you know if we should also call `msg.sendComplete(ex);` in this 
block? It seems like these messages would have failed, as the producer is 
closed and these are pending messages. (This comment is independent of your PR. 
I'm just asking because I noticed it in the surrounding code while reviewing 
your PR.)




-- 
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]


Reply via email to