mirror of https://github.com/apache/druid.git
Fix NPE in postCleanupStage if stage doesn't exist (#13742)
With fault tolerance enabled in MSQ, not all the work orders might be populated if the worker is restarted. In case it gets the request for cleaning up the stage which is not present in the worker's map, it can throw an NPE. Added a check to ensure that the stage is present in the map before cleaning it up, or else logging it as a warning.
This commit is contained in:
parent
c5835c29a1
commit
9100a61bf6
|
@ -574,7 +574,12 @@ public class WorkerImpl implements Worker
|
||||||
holder -> {
|
holder -> {
|
||||||
cleanStageOutput(stageId, true);
|
cleanStageOutput(stageId, true);
|
||||||
// Mark the stage as FINISHED
|
// Mark the stage as FINISHED
|
||||||
holder.getStageKernelMap().get(stageId).setStageFinished();
|
WorkerStageKernel stageKernel = holder.getStageKernelMap().get(stageId);
|
||||||
|
if (stageKernel == null) {
|
||||||
|
log.warn("Stage id [%s] non existent. Unable to mark the stage kernel for it as FINISHED", stageId);
|
||||||
|
} else {
|
||||||
|
stageKernel.setStageFinished();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue