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

LIHADOOP-43781: TonY should support enforcing maximum total number of tasks #174

Merged
merged 5 commits into from
Feb 5, 2019

Conversation

erwa
Copy link
Contributor

@erwa erwa commented Feb 5, 2019

Addresses #169.

  • Added tony.X.max-instances and tony.task.max-total-instances configs that allow limiting the number of X instances or total task instances a job can request.
  • Added validation in TonyClient that enforces the limits and to throws a RuntimeException if violated
  • Added unit tests

@erwa erwa requested review from oliverhu and hungj February 5, 2019 20:13
static void validateTonyConf(Configuration tonyConf) {
int maxTasks = tonyConf.getInt(TonyConfigurationKeys.TONY_MAX_TASKS, -1);
if (maxTasks >= 0) {
int numRequestedTasks = Utils.parseContainerRequests(tonyConf).values().stream()
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fine, but have we considered whether we want a per-jobtype limit or an aggregate limit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. I'll add per-jobtype limit support, too (e.g.: tony.worker.max-tasks).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my latest commit, added tony.X.max-instances and renamed the global limit to tony.task.max-total-instances.

Copy link
Contributor

@hungj hungj left a comment

Choose a reason for hiding this comment

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

lgtm!

@erwa erwa merged commit a60967f into master Feb 5, 2019
@oliverhu oliverhu deleted the enforce-30-task-limit branch March 3, 2019 20:41
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.

None yet

2 participants