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

set a maximum limit for the forks per job #5142

Closed
anxstj opened this issue Oct 29, 2019 · 4 comments
Closed

set a maximum limit for the forks per job #5142

anxstj opened this issue Oct 29, 2019 · 4 comments

Comments

@anxstj
Copy link
Contributor

anxstj commented Oct 29, 2019

ISSUE TYPE
  • Feature Idea
SUMMARY

In small environments (one node setups) a job may increase the maximum capacity in terms of forks which might crash the system.
Therefore I suggest a global options (maybe per instance) which sets a limit for the number of forks per job. If a job increases this limit it should be prevented from running or saving the job template should result in an error.

@wenottingham
Copy link
Contributor

This is actualy needed in larger setups more often.

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Jan 15, 2020

@matburt @jakemcdermott @wenottingham

https://github.com/ansible/awx/pull/5604/files#diff-82158f398fa5f587f3a95c3060cb05c9R622

Should we set some sane default for all new installs so people don't have to type in 1000 and induce a nuclear meltdown to learn this setting exists? I recall the core folks basically saying there was a theoretical limit anyways where Ansible couldn't keep up, and that raising it would only make things worse.

@matburt
Copy link
Member

matburt commented Jan 20, 2020

The solution looks good to me.

@elyezer elyezer self-assigned this Jan 30, 2020
@elyezer
Copy link
Member

elyezer commented Feb 11, 2020

Did this in order to verify this one:

  1. Updated the MAX_FORKS to 4 on the Jobs settings
  2. Tried to set a job template max forks option to anything greater than 4. It provided the expected validation error.
  3. Left the job template max forks set to 4 and updated the MAX_FORKS to 1 on the settings page.
  4. Triggered the job template and, as expected, the following log message was printed:
awx_1        | 2020-02-11 19:17:21,461 WARNING  awx.main.tasks Maximum number of forks (1) exceeded.

With all that we can consider this issue verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants