Fix NPE in DagManager cleanup
Under certain conditions, we can get a null list
when checking if
dag has a running job. This is a quickfix to
address that.
Closes from aplex/dag-manager-npe
@@ -1102,7 +1102,8 @@ public class DagManager extends AbstractIdleService {
}
private boolean hasRunningJobs(String dagId) {
- return !this.dagToJobs.get(dagId).isEmpty();
+ List<DagNode<JobExecutionPlan>> dagNodes = this.dagToJobs.get(dagId);
+ return dagNodes != null && !dagNodes.isEmpty();
}
private ContextAwareCounter getRunningJobsCounter(DagNode<JobExecutionPlan> dagNode) {
