steveloughran commented on code in PR #5133: URL: https://github.com/apache/hadoop/pull/5133#discussion_r1021743476
########## hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ReadBufferWorker.java: ########## @@ -84,4 +93,16 @@ public void run() { } } } + + private boolean postFailureWhenStreamClosed(ReadBufferManager bufferManager, + ReadBuffer buffer) { + + // When stream is closed report failure to be picked by eviction + if (buffer.getStream().isClosed()) { + // Fail read + bufferManager.doneReading(buffer, ReadBufferStatus.READ_FAILED, 0); Review Comment: we should have an explicit Stream closed event here ########## hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ReadBufferManager.java: ########## @@ -247,7 +247,7 @@ private synchronized boolean tryEvict() { // first, try buffers where all bytes have been consumed (approximated as first and last bytes consumed) for (ReadBuffer buf : completedReadList) { - if (buf.isFirstByteConsumed() && buf.isLastByteConsumed()) { + if (buf.getStream().isClosed() || (buf.isFirstByteConsumed() && buf.isLastByteConsumed())) { Review Comment: if the closed state is recorded in the buffer, no need to go through to the stream -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org