NealSun96 commented on a change in pull request #1231:
URL: https://github.com/apache/helix/pull/1231#discussion_r467319079



##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskUtil.java
##########
@@ -733,10 +734,29 @@ protected static boolean removeJobsFromWorkflow(final 
HelixDataAccessor dataAcce
     if (workflowContext != null) {
       Map<String, TaskState> jobStates = workflowContext.getJobStates();
       for (String job : workflowConfig.getJobDag().getAllNodes()) {
+        if (expiredJobs.contains(job)) {
+          continue;
+        }
         JobConfig jobConfig = TaskUtil.getJobConfig(dataAccessor, job);
         JobContext jobContext = TaskUtil.getJobContext(propertyStore, job);
-        if (isJobExpired(job, jobConfig, jobContext, jobStates.get(job))) {
+        TaskState jobState = jobStates.get(job);

Review comment:
       jobState could be null in an erroneous state where a job is in the DAG 
but not in jobState map, but is that a situation we need to consider? This 
logic here wouldn't interact with such a job as it fails the jobState check 
conditions. I think it's fine to not deal with that case. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to