Skip to content

Evenly-spread task placement #1576

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

Merged
merged 7 commits into from
Jul 14, 2017
Merged

Evenly-spread task placement #1576

merged 7 commits into from
Jul 14, 2017

Conversation

baconmania
Copy link
Contributor

No description provided.

@ssalinas ssalinas modified the milestone: 0.17.0 Jun 29, 2017
@@ -333,7 +333,8 @@ public void testFrozenSlaveCanBeDecommissioned() {

saveAndSchedule(request.toBuilder().setSlavePlacement(Optional.of(SlavePlacement.OPTIMISTIC)).setInstances(Optional.of(2)));
Copy link
Member

@ssalinas ssalinas Jul 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to change this to GREEDY or SEPARATE so that the frozen slave test isn't relying on calculations from optimistic


final boolean isSlaveOk = numOnSlave < numPerSlave;
// If no tasks are active for this request yet, we can fall back to greedy.
if (currentlyActiveTasksForRequestClusterwide.size() > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to make this more explicit with a == 0 check + early return rather than having to add a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so the general pattern in this method is to return only if the SlaveMatchState is determined to be something other than OK. Otherwise, flow is allowed to trickle down to that final return SlaveMatchState.OK statement.

final boolean isSlaveOk = numOnSlave <= numPerSlave;

if (!isSlaveOk) {
LOG.trace("Rejecting OPTIMISTIC task {} from slave {} ({}) due to numOnSlave {}", taskRequest.getRequest().getId(), slaveId, host, numOnSlave);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to add the other values you're using in he calculation in here for debugging purposes

@baconmania baconmania changed the title (WIP) Evenly-spread task placement Evenly-spread task placement Jul 6, 2017
@ssalinas ssalinas merged commit 7ad28fd into master Jul 14, 2017
@ssalinas ssalinas deleted the evenly-spread-task-placement branch July 14, 2017 19:40
@baconmania baconmania modified the milestones: 0.18.0, 0.17.0 Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants