Github user NicoK commented on a diff in the pull request: https://github.com/apache/flink/pull/4517#discussion_r141345178 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java --- @@ -242,21 +239,22 @@ ByteBuf write(ByteBufAllocator allocator) throws IOException { throw new IOException(t); } finally { - if (buffer != null) { - buffer.recycle(); - } + buffer.recycle(); } } - @Override - void readFrom(ByteBuf buffer) { - receiverId = InputChannelID.fromByteBuf(buffer); - sequenceNumber = buffer.readInt(); - isBuffer = buffer.readBoolean(); - size = buffer.readInt(); - - retainedSlice = buffer.readSlice(size); - retainedSlice.retain(); + static BufferResponse readFrom(ByteBuf buffer) { + BufferResponse result = new BufferResponse(); --- End diff -- I agree we could change that, too - and partly I did in another commit that didn't go into a PR yet. Let's do this for all classes then.
---