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/20 05:24:18 UTC

[GitHub] jvrao commented on a change in pull request #1277: WIP - Use ByteBufOutputStream to serialize ProtoBuf messages

jvrao commented on a change in pull request #1277: WIP - Use ByteBufOutputStream to serialize ProtoBuf messages
URL: https://github.com/apache/bookkeeper/pull/1277#discussion_r175658262
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtoEncoding.java
 ##########
 @@ -356,7 +355,7 @@ private static ByteBuf serializeProtobuf(MessageLite msg, ByteBufAllocator alloc
         ByteBuf buf = allocator.heapBuffer(size, size);
 
         try {
-            msg.writeTo(CodedOutputStream.newInstance(buf.array(), buf.arrayOffset() + buf.writerIndex(), size));
+            msg.writeTo(new ByteBufOutputStream(buf));
 
 Review comment:
   Is this a race or corruption happens all the time?  Change looks fine, but I did not understand the actual issue with the current code on why corruption happening. 

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