HDFS-11883: [SPS] : Handle NPE in BlockStorageMovementTracker when dropSPSWork() called. Contributed by Surendra Singh Lilhore.
This commit is contained in:
parent
5ce332dc9a
commit
e53f89ccc3
@ -88,13 +88,17 @@ public void run() {
|
|||||||
long trackId = result.getTrackId();
|
long trackId = result.getTrackId();
|
||||||
List<Future<BlockMovementResult>> blocksMoving = moverTaskFutures
|
List<Future<BlockMovementResult>> blocksMoving = moverTaskFutures
|
||||||
.get(trackId);
|
.get(trackId);
|
||||||
|
if (blocksMoving == null) {
|
||||||
|
LOG.warn("Future task doesn't exist for trackId " + trackId);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
blocksMoving.remove(future);
|
blocksMoving.remove(future);
|
||||||
|
|
||||||
List<BlockMovementResult> resultPerTrackIdList =
|
List<BlockMovementResult> resultPerTrackIdList =
|
||||||
addMovementResultToTrackIdList(result);
|
addMovementResultToTrackIdList(result);
|
||||||
|
|
||||||
// Completed all the scheduled blocks movement under this 'trackId'.
|
// Completed all the scheduled blocks movement under this 'trackId'.
|
||||||
if (blocksMoving.isEmpty()) {
|
if (blocksMoving.isEmpty() || moverTaskFutures.get(trackId) == null) {
|
||||||
synchronized (moverTaskFutures) {
|
synchronized (moverTaskFutures) {
|
||||||
moverTaskFutures.remove(trackId);
|
moverTaskFutures.remove(trackId);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user