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:42:00 UTC

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

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

 ##########
 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:
   I believe that when the flush is called, the whole chain of handlers is invoked. Therefore, even if the channel is not writable, we should already have converted the add response into a buffer.

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