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 2021/09/03 01:11:56 UTC

[GitHub] [pulsar] Shoothzj opened a new pull request #11906: Forget to update memory usage on producer close

Shoothzj opened a new pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906


   ### Motivation
   
   The client doesn't upate the memory counter when producer close
   
   ### Modifications
   
   When the producer close, update the memory usage too.
   
   ### Documentation
   
   We don't need to update docs, because it's a bug fix.
   


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



[GitHub] [pulsar] merlimat merged pull request #11906: Forget to update memory usage on producer close

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906


   


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



[GitHub] [pulsar] Shoothzj commented on pull request #11906: Forget to update memory usage on producer close

Posted by GitBox <gi...@apache.org>.
Shoothzj commented on pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906#issuecomment-913334868


   @codelipenghui @hangc0276 @eolivelli @lhotari @merlimat @sijie 


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



[GitHub] [pulsar] Shoothzj commented on pull request #11906: Forget to update memory usage on producer close

Posted by GitBox <gi...@apache.org>.
Shoothzj commented on pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906#issuecomment-912244707


   @merlimat @hangc0276 @eolivelli PTAL


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



[GitHub] [pulsar] Shoothzj closed pull request #11906: Forget to update memory usage on producer close

Posted by GitBox <gi...@apache.org>.
Shoothzj closed pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906


   


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



[GitHub] [pulsar] Shoothzj commented on a change in pull request #11906: Forget to update memory usage on producer close

Posted by GitBox <gi...@apache.org>.
Shoothzj commented on a change in pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906#discussion_r701667065



##########
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:
       You are right, we should also call `msg.sendComplete(ex)` too,  I can fix it after this PR being `merged`




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



[GitHub] [pulsar] Shoothzj closed pull request #11906: Forget to update memory usage on producer close

Posted by GitBox <gi...@apache.org>.
Shoothzj closed pull request #11906:
URL: https://github.com/apache/pulsar/pull/11906


   


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



[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #11906: Forget to update memory usage on producer close

Posted by GitBox <gi...@apache.org>.
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org