sodonnel commented on code in PR #10415:
URL: https://github.com/apache/ozone/pull/10415#discussion_r3375192743
##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamBlockInputStream.java:
##########
@@ -444,36 +507,16 @@ private ByteBuffer read(int length, boolean preRead)
throws IOException {
readBlock(length, preRead);
while (true) {
- final ByteBuffer buf = readFromQueue();
- if (buf != null && buf.hasRemaining()) {
- return buf;
+ final ReadBlockResponseProto proto = poll();
+ final ByteBuffer buffer = getByteBuffer(proto, getPos());
Review Comment:
When poll() returns null (end of stream) at line 510, the null proto is
passed into getByteBuffer where it will NPE as there is no null check.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]