You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/14 16:38:24 UTC

[GitHub] ivankelly commented on a change in pull request #1260: Recycle the AddResponse in WriteEntryProcessor

ivankelly commented on a change in pull request #1260: Recycle the AddResponse in WriteEntryProcessor
URL: https://github.com/apache/bookkeeper/pull/1260#discussion_r174526680
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessor.java
 ##########
 @@ -114,9 +115,10 @@ public void writeComplete(int rc, long ledgerId, long entryId,
             requestProcessor.addEntryStats.registerFailedEvent(MathUtils.elapsedNanos(startTimeNanos),
                     TimeUnit.NANOSECONDS);
         }
-        sendResponse(rc,
-                     ResponseBuilder.buildAddResponse(request),
-                     requestProcessor.addRequestStats);
+
+        Response response = ResponseBuilder.buildAddResponse(request);
+        sendResponse(rc, response, requestProcessor.addRequestStats);
 
 Review comment:
   sendResponse calls channel.writeAndFlush(response...). Are we sure that the writeAndFlush isn't keeping a reference to response somewhere?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services