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/12/15 08:15:27 UTC

[GitHub] [pulsar] poorbarcode commented on a diff in pull request #18928: [fix][broker] Fix direct memory leak in RawReaderImpl

poorbarcode commented on code in PR #18928:
URL: https://github.com/apache/pulsar/pull/18928#discussion_r1049193185


##########
pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java:
##########
@@ -203,12 +232,17 @@ public CompletableFuture<Void> seekAsync(MessageId messageId) {
 
         @Override
         public CompletableFuture<Void> closeAsync() {
+            CompletableFuture<Void> closeFuture = super.closeAsync();
             reset();
-            return super.closeAsync();
+            return closeFuture;
         }
 
         @Override
         void messageReceived(CommandMessage commandMessage, ByteBuf headersAndPayload, ClientCnx cnx) {
+            State state = getState();
+            if (state == State.Closing || state == State.Closed) {
+                return;

Review Comment:
   Should we release `headersAndPayload ` here?



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