Skip to content

Commit e556425

Browse files
committed
adds in null checks for tracker
1 parent 5834ea9 commit e556425

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/common/CachingBlockManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ private void readBlock(BufferData data, boolean isPrefetch, BufferData.State...
348348
String message = String.format("error during readBlock(%s)", data.getBlockNumber());
349349
LOG.error(message, e);
350350

351-
if(isPrefetch) {
351+
if (isPrefetch && tracker != null) {
352352
tracker.failed();
353353
}
354354

@@ -362,7 +362,9 @@ private void readBlock(BufferData data, boolean isPrefetch, BufferData.State...
362362

363363
if (isPrefetch) {
364364
prefetchingStatistics.prefetchOperationCompleted();
365-
tracker.close();
365+
if (tracker != null) {
366+
tracker.close();
367+
}
366368
}
367369
}
368370
}

0 commit comments

Comments
 (0)