[BUG] salt-master wastes time writing event data to standard out when executing runner functions through the api
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
I was doing some profiling to try and understand why some of my salt api requests were so slow and I noticed that the salt-master spends some considerable time in display_output printing data to standard out, which for me is /dev/null.
I've worked around this by setting quiet: True in my salt master configuration. But this doesn't seem to be documented anywhere.
In addition I notice that when the RunnerClient is constructed in salt.master.Maintenance._post_fork_init quiet is forced to True, but when the runner client used by the api is constructed in salt.master.ClearFuncs.runner it isn't. I wonder if it should be.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Salt Version:
Salt: 3001
Dependency Versions:
cffi: 1.11.5
cherrypy: unknown
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.10.1
libgit2: Not Installed
M2Crypto: Not Installed
Mako: 1.0.9
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.14
pycrypto: Not Installed
pycryptodome: 3.9.8
pygit2: Not Installed
Python: 3.6.8 (default, Mar 21 2019, 10:08:12)
python-gnupg: Not Installed
PyYAML: 5.1
PyZMQ: 17.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.6
System Versions:
dist: fedora 28 Twenty Eight
locale: utf-8
machine: x86_64
release: 4.7.10
system: Linux
version: Fedora 28 Twenty Eight
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in salt.master.Maintenance._post_fork_init and salt.master.ClearFuncs.runner, then trace how RunnerClient handles quiet and how display_output writes event data to standard output. Compare the two construction paths and verify that API runner calls no longer spend time writing event data to stdout while preserving the documented quiet configuration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100