Skip to content

don't include cleaning tasks in instance count#1505

Merged
ssalinas merged 7 commits into
masterfrom
provisioned
May 1, 2017
Merged

don't include cleaning tasks in instance count#1505
ssalinas merged 7 commits into
masterfrom
provisioned

Conversation

@matush-v
Copy link
Copy Markdown
Contributor

Tasks that are cleaning should not be part of the instance count when checking for over provisioned requests

@ssalinas

c = new Counter();
map.put(key, c);
}
Counter c = map.computeIfAbsent(key, k -> new Counter());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we are not using the key in order to determine the value here, should use putIfAbsent instead of computeIfAbsent. Same for the one below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

small gotcha for putIfAbsent: turns out putIfAbsent returns the old value (null) so computeIfAbsent is what we want here (returns existing or computed)
bitmoji

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 good find, didn't realize that one

}

for (SingularityTaskId cleaningTaskId : taskManager.getCleanupTaskIds()) {
numTasks.decr(cleaningTaskId.getRequestId());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we still want to include cleaning when checking for under provisioned, this will exclude it for both under and over? Trying to make sure we avoid any false alerts if possible

Copy link
Copy Markdown
Contributor Author

@matush-v matush-v Apr 13, 2017

Choose a reason for hiding this comment

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

I believe so. I'm imagining a request that should have 3 instances, but has 2 running and 1 cleaning. Since we're still counting pending tasks, if one task is pending, then the count is correct, otherwise, it's under provisioned. I think counting cleaning tasks may actually have made us miss potential under provisioned requests in the past

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 cool, let's give this a go in staging/qa then

@matush-v matush-v added the hs_qa label Apr 18, 2017
@ssalinas ssalinas modified the milestone: 0.15.0 Apr 19, 2017
@ssalinas
Copy link
Copy Markdown
Contributor

👍 lets get this into stable

@ssalinas
Copy link
Copy Markdown
Contributor

Just verifying the merge conflicts got resolved correctly and will merge this one too 👍

@ssalinas ssalinas merged commit c8b352b into master May 1, 2017
@ssalinas ssalinas deleted the provisioned branch May 1, 2017 13:13
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