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

Make full-output configurable #128

Open
chforster opened this issue Aug 27, 2018 · 4 comments
Open

Make full-output configurable #128

chforster opened this issue Aug 27, 2018 · 4 comments

Comments

@chforster
Copy link

chforster commented Aug 27, 2018

I currently have the problem that my Jenkins runs into an "OutOfMemory" Exception when performing a 'cmd.run' on multiple machines which have a big return (e.g. unzip a large file without quiet parameter).
Same occurs when applying states.

It would be nice to make the "full_return" configurable which is currently hardcoded

saltFunc.put("full_return", true);

@mchugh19
Copy link

Sure, that makes sense. I'll look into adding that.

@mchugh19
Copy link

mchugh19 commented Aug 29, 2018

I've been looking over the output and am not quite sure why you are seeing the OutOfMemory error.

Here's an example of a tar extraction run via the salt-api and cmd.run:

{"return": [{"master": "./
./_modules/
./_modules/saltcheck.py
...
"}]}

Here's the same job run with full_return: "True"

{"return": [{"master": {"jid": "20180829153616106818", "retcode": 0, "ret": "./
./_modules/
./_modules/saltcheck.py
...
"}}]}

I can make a release which disables the full_return option, but it might be in the parsing of the large json return that you are actually seeing the problem. I'll work up a beta release to disable full_return, and we can go from there.

As a quick test, you could try enabling the "Skip validation of salt return" option. This should skip over the processing of any large JSON output.

@chforster
Copy link
Author

chforster commented Aug 30, 2018

Currenty I can not reproduce the Issue due to missing system resources.

It happened when applying a state via your Jenkins Plugin NOT async and parallel on 10 machines (wildcard grain), which triggered a shell script (via cmd.run) which then extracted a big tar file (1.2G - approx 50.000 Files).
The log Output was not saved to a specific Workspace File but in Jenkins System Log.

Here my environment Info:

  • Jenkins 2.140
  • Saltstack Plugin 3.2.0
  • salt 2018.3.0 (Oxygen)
  • salt-api 2018.3.0 (Oxygen)
  • TornadoServer/4.2.1

Configuration in Jenkins:

  • SaltAPI Version: 2017.7
  • Display format: json

I recently solved the Problem by applying the state directly on the saltmaster and not from Jenkins.

@mchugh19
Copy link

mchugh19 commented Aug 30, 2018

If you are able to capture the salt-api output of that operation, could you sent it to me? ([email protected]) That use case could be used to test large json returns.

Also, if you ever run into problems like that in the future, try skipping validation of the return. That is the probable cause of resource utilization.

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

No branches or pull requests

2 participants