Github user NicoK commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4518#discussion_r141373324
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
 ---
    @@ -440,12 +440,11 @@ ByteBuf write(ByteBufAllocator allocator) throws 
IOException {
                static TaskEventRequest readFrom(ByteBuf buffer, ClassLoader 
classLoader) throws IOException {
                        TaskEventRequest result = new TaskEventRequest();
     
    -                   // TODO Directly deserialize fromNetty's buffer
    +                   // directly deserialize fromNetty's buffer
                        int length = buffer.readInt();
    -                   ByteBuffer serializedEvent = 
ByteBuffer.allocate(length);
    -
    -                   buffer.readBytes(serializedEvent);
    -                   serializedEvent.flip();
    +                   ByteBuffer serializedEvent = buffer.nioBuffer();
    --- End diff --
    
    yes, makes sense to change this as an additional safeguard


---

Reply via email to