ccding commented on a change in pull request #11080: URL: https://github.com/apache/kafka/pull/11080#discussion_r672758944
########## File path: clients/src/main/java/org/apache/kafka/common/record/DefaultRecord.java ########## @@ -293,7 +293,9 @@ public static DefaultRecord readFrom(ByteBuffer buffer, Long logAppendTime) { int sizeOfBodyInBytes = ByteUtils.readVarint(buffer); if (buffer.remaining() < sizeOfBodyInBytes) - return null; + throw new InvalidRecordException("Invalid record size: expected " + sizeOfBodyInBytes + + " bytes in record payload, but instead the buffer has only " + buffer.remaining() + + " remaining bytes."); Review comment: Are you saying the case that we are yet to complete reading the request? I didn't see a retry path, but it will cause a null point exception at https://github.com/apache/kafka/blob/bfc57aa4ddcd719fc4a646c2ac09d4979c076455/core/src/main/scala/kafka/log/LogValidator.scala#L191 What do you suggest me do here? ########## File path: clients/src/main/java/org/apache/kafka/common/record/DefaultRecord.java ########## @@ -293,7 +293,9 @@ public static DefaultRecord readFrom(ByteBuffer buffer, Long logAppendTime) { int sizeOfBodyInBytes = ByteUtils.readVarint(buffer); if (buffer.remaining() < sizeOfBodyInBytes) - return null; + throw new InvalidRecordException("Invalid record size: expected " + sizeOfBodyInBytes + + " bytes in record payload, but instead the buffer has only " + buffer.remaining() + + " remaining bytes."); Review comment: Are you saying the case that we are yet to complete reading the request? I didn't see a retry path, but it will cause a null point exception at https://github.com/apache/kafka/blob/bfc57aa4ddcd719fc4a646c2ac09d4979c076455/core/src/main/scala/kafka/log/LogValidator.scala#L191 What do you suggest I do here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org