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
Grains refreshes every time you run salt cmd #51593
Comments
@saltstack/team-core Does anyone have input to provide on this? |
I'll look into this tomorrow. |
Hi @angeloudym, thanks for the report! When you say that the grains are being refreshed, what do you mean? I'm only seeing the grains refresh when
If that's present, it'll reload the grains, but otherwise I'm not seeing that happen. Can you produce a mcve that demonstrates the issue that you're seeing? |
My first observation was that every time I run the
From my understanding, these To verify,
Then run Output is
|
In fact, if you run
|
Hi, I am seeing this on 2019.2.0 as well. Just doing a test.ping takes about 6 seconds - and looking at the debug on the (windows) minion - i could see the "Grains refresh requested. Refreshing grains.". Is there a way to change this without having to update each minion config file? |
That's interesting - I wonder if this is due to orchestration. I've seen a couple of things come across recently about salt-run vs salt. |
In my testing i did it on the master both via salt 'minion' test.ping, and also sending it to the CherryPy API. |
I guess the main question is what is setting There's not much documentation for |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
I am having the same issue in 2019.2.3 without any orchestration. Running one state via I never have set reload_grains anywhere |
I'm seeing this issue in 3000.3. The grains are being refreshed on every salt command run from the master. Even test.ping. We have a custom grain which can't reach an external api and the python requests module goes into retry mode. The result is the minion does not return. |
This also happens with 3003.3. It looks like the grains are refreshed every time on module invocation and when
|
@waynew : can you re-open the ticket or should I create a new one? |
The reason why salt grains refreshes every time you run the salt runner command is that when salt runner execute some commands, it will initialize a MasterMinion first Line 299 in b30ccda
And the masterminion class will reload the grains during initialization Line 977 in b30ccda
To avoid this, I added these lines to master config. It will cache grains for masterminion. Therefore, it will not refresh grains everytime you run the salt runner commands.
|
Grains data get refreshed every time you run
salt
orsalt-run
cmd.I think it was introduced by this #18351
After I added the following lines the minion config, it stops refreshing the minion grains.
This can stop the minion refreshing grains data, which helped improving the performance.
The question now is how do I prevent
salt-run
from refreshing the grains.I have a lot of runners that run as schedulers. Refreshing all grains introduces some unnecessary overhead.
The text was updated successfully, but these errors were encountered: