Skip to content

Commit

Permalink
[GOBBLIN-1844] Ignore workflows marked for deletion when calculating …
Browse files Browse the repository at this point in the history
…container count
  • Loading branch information
homatthew committed Jun 21, 2023
1 parent fc508ca commit 718af52
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 347 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;


import org.apache.commons.compress.utils.Sets;
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.helix.HelixDataAccessor;
Expand All @@ -39,6 +38,7 @@
import org.apache.helix.task.JobConfig;
import org.apache.helix.task.JobContext;
import org.apache.helix.task.JobDag;
import org.apache.helix.task.TargetState;
import org.apache.helix.task.TaskDriver;
import org.apache.helix.task.TaskPartitionState;
import org.apache.helix.task.TaskState;
Expand Down Expand Up @@ -220,16 +220,18 @@ void runInternal() {
YarnContainerRequestBundle yarnContainerRequestBundle = new YarnContainerRequestBundle();
for (Map.Entry<String, WorkflowConfig> workFlowEntry : taskDriver.getWorkflows().entrySet()) {
WorkflowContext workflowContext = taskDriver.getWorkflowContext(workFlowEntry.getKey());
WorkflowConfig workflowConfig = workFlowEntry.getValue();

// Only allocate for active workflows
if (workflowContext == null || !workflowContext.getWorkflowState().equals(TaskState.IN_PROGRESS)) {
// Only allocate for active workflows and those not marked for delete
if (workflowContext == null ||
TargetState.DELETE.equals(workflowConfig.getTargetState()) ||
!workflowContext.getWorkflowState().equals(TaskState.IN_PROGRESS)) {
continue;
}

log.debug("Workflow name {} config {} context {}", workFlowEntry.getKey(), workFlowEntry.getValue(),
workflowContext);

WorkflowConfig workflowConfig = workFlowEntry.getValue();
JobDag jobDag = workflowConfig.getJobDag();
Set<String> jobs = jobDag.getAllNodes();

Expand Down
Loading

0 comments on commit 718af52

Please sign in to comment.