Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GOBBLIN-1844] Ignore workflows marked for deletion when calculating container count #3709

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,19 @@ 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. Those marked for deletion are ignored but the existing containers won't
// be released until maxIdleTimeInMinutesBeforeScalingDown
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
Loading