salt icon indicating copy to clipboard operation
salt copied to clipboard

How to turn the different timeout values

Open emasean opened this issue 8 years ago • 14 comments

In https://github.com/saltstack/salt/issues/46518, it was stated:

the master will send the command to the minion then wait 5 seconds, if it still has not gotten a return it will try to run another command checking for the status of the job and wait another 5 seconds. And the other 5 seconds not accounted for in the first example @nitinjain999 posted is just the salt client initiating/sending/receiving. Is this correct or would we expect the salt cli to kill sooner?

Two questions:

  1. Are those two latter timeout values configurable?
  2. If 1 is positive, where can we find those configurations?

emasean avatar Mar 24 '18 05:03 emasean

you can configure the check for running jobs using gather_job_timeout as documented here: https://docs.saltstack.com/en/latest/ref/configuration/master.html#gather-job-timeout

Ch3LL avatar Mar 27 '18 14:03 Ch3LL

so what is the minimum timeout allowed/recommended for those values and at the same time not causing false negatives (too small timeout reporting the minions are down despite its up since the network RTT is simply larger than the timeout).

emasean avatar Apr 25 '18 16:04 emasean

well https://www.suse.com/documentation/suse-manager-3/book_suma_best_practices_3/data/bp_chap_salt_minion_scaleability_timeouts.html explains it, so I assume if the network RTT is maximum 2 sec, we can set 1 sec to timeout and 1 sec to gather_job_timeout

emasean avatar Apr 25 '18 16:04 emasean

Worth mention that this network RTT is just a generic term, not exactly 1 RTT between the salt-master and salt-minion since test.ping is not ICMP ping, its on TCP level I assume, so it involves several RTTs between the salt-master and the minions.

emasean avatar Apr 25 '18 16:04 emasean

Can we set those timeouts on per-request-basis? test.ping should have lower timeout while state.apply should have higher timeout otherwise they will certainly timeout with 1:1 as values.

emasean avatar Apr 25 '18 18:04 emasean

According to the following documentation: https://docs.saltstack.com/en/latest/ref/cli/salt.html the timeout can be tuned per-request-basis but not gather_job_timeout, is there anyway to steer gather_job_timeout as well per-request-basis?

emasean avatar Apr 26 '18 04:04 emasean

we could probably add an option to allow someone to set it that way. I'll approve as a feature request.

Ch3LL avatar Apr 26 '18 14:04 Ch3LL

So the defaults configurations were: timeout: 5 sec gather_job_timeout: 10 sec (total 15 sec)

We change the defaults to: timeout: 14 sec gather_job_timeout: 1 sec (total 15 sec)

and when invoking test.ping, we specify the timeout to be 1, so total 2 sec.

emasean avatar Apr 26 '18 18:04 emasean

We have another question regarding this topic, we are running orchestration on the master and wonder if we can set a different timeout overriding the default for individual state within the orchestration?

emasean avatar Mar 11 '19 15:03 emasean

it looks like there is a timeout arg for some of the functions in here: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.saltmod.html

Ch3LL avatar Mar 13 '19 14:03 Ch3LL

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.

stale[bot] avatar Jan 08 '20 23:01 stale[bot]

Thank you for updating this issue. It is no longer marked as stale.

stale[bot] avatar Jan 09 '20 19:01 stale[bot]

We recently started managing windows salt-minions and noticed that windows salt-minion has much higher rate of Minion did not return. [No response].

After some searching we suspect it's because windows minions sometimes failed to return the find_job job within gather_job_timeout timeout.

Increasing this gather_job_timeout seems to help in this situation. But we are hesitant to increase this timeout in master config as this global change will make salt command to take longer time to return when some minion is actually offline.

We hope we can override this gather_job_timeout per command.

seanzhang422 avatar Jul 08 '21 20:07 seanzhang422

This feature would be extremely helpful. Adding gather_job_timeout to the command client as a flag (similar to -t X) would help for known long running commands.

nschoonm avatar Dec 14 '22 16:12 nschoonm