[ https://issues.apache.org/jira/browse/HADOOP-18546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17642457#comment-17642457 ]
ASF GitHub Bot commented on HADOOP-18546: ----------------------------------------- steveloughran commented on code in PR #5176: URL: https://github.com/apache/hadoop/pull/5176#discussion_r1038058686 ########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsInputStream.java: ########## @@ -495,6 +509,199 @@ public void testSuccessfulReadAhead() throws Exception { checkEvictedStatus(inputStream, 0, true); } + /** + * This test expects InProgressList is not purged by the inputStream close. + * The readBuffer will move to completedList and then finally should get evicted. + */ + @Test + public void testStreamPurgeDuringReadAheadCallExecuting() throws Exception { + AbfsClient client = getMockAbfsClient(); + AbfsRestOperation successOp = getMockRestOp(); + + final AtomicInteger movedToInProgressList = new AtomicInteger(0); + final AtomicInteger movedToCompletedList = new AtomicInteger(0); + final AtomicBoolean preClosedAssertion = new AtomicBoolean(false); + + Mockito.doAnswer(invocationOnMock -> { + movedToInProgressList.incrementAndGet(); + while (movedToInProgressList.get() < 3 || !preClosedAssertion.get()) { + + } + movedToCompletedList.incrementAndGet(); + return successOp; + }) + .when(client) Review Comment: it may be slow, but at least there's no assertion that something finishes *before* a specific timeout. those are the tests which really have problems on slow networks/overloaded systems > disable purging list of in progress reads in abfs stream closed > --------------------------------------------------------------- > > Key: HADOOP-18546 > URL: https://issues.apache.org/jira/browse/HADOOP-18546 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/azure > Affects Versions: 3.3.4 > Reporter: Steve Loughran > Assignee: Steve Loughran > Priority: Major > Labels: pull-request-available > > turn off the prune of in progress reads in > ReadBufferManager::purgeBuffersForStream > this will ensure active prefetches for a closed stream complete. they wiill > then get to the completed list and hang around until evicted by timeout, but > at least prefetching will be safe. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org