FIX: give the push orchestration's state steps a 60s timeout

A push queued behind a highstate was reported as failed although its
state run later completed with no failed states. The orchestration polls
a queued run with saltutil.find_job every 10s and, at the default 5s
timeout, abandons it as soon as one reply takes longer than
gather_job_timeout (10s). On a busy manager a reply waited 10.4s behind a
master worker that was compiling pillar, and the step failed with an
empty return 0.3s before the reply was processed.

The same 5s timeout is how long the client waits for the master to accept
the publish before sending it again, so a 6s stall published the state
run twice and it ran twice.

With timeout above gather_job_timeout, a minion seen running within the
last 60s is kept, a late reply resumes polling, and the publish is only
resent after 60s of silence. A step still returns as soon as the minion
does. A minion that really dies mid-run is noticed about 60s later.

On a standalone 3.5.0 install, with the state queue held and the minion
frozen for 22s, the step previously failed with "Run failed on minions";
it now waits and succeeds, with one state run published.
This commit is contained in:
Josh Patterson committed 2026-11-18 14:11:14 -05:00
1 parent aba2f5ea43
commit 5d956de587
1 file changed
+5
+5
View File
@@ -2,6 +2,9 @@
{% set actions = salt['pillar.get']('actions', []) %}
{% set BATCH = AUTOAPPLY.batch %}
{% set BATCH_WAIT = AUTOAPPLY.batch_wait %}
{# Must exceed gather_job_timeout (10s): at the 5s default, one saltutil.find_job reply slower than that abandons
a queued state run, and a master slow to accept the publish gets it a second time. #}
{% set STATE_TIMEOUT = 60 %}
{# queue must be a top-level salt.state arg (kwarg is ignored); an int is max_queue and still fails on conflict #}
{# refresh_pillar doubles as the reachability check: minions take up to ~22s to rejoin a restarted master's
@@ -26,6 +29,7 @@ apply_highstate_{{ loop.index }}:
- batch: {{ action.get('batch', BATCH) }}
- batch_wait: {{ action.get('batch_wait', BATCH_WAIT) }}
- queue: True
- timeout: {{ STATE_TIMEOUT }}
- require:
- salt: refresh_pillar_{{ loop.index }}
{% else %}
@@ -38,6 +42,7 @@ apply_{{ action.state | replace('.', '_') }}_{{ loop.index }}:
- batch: {{ action.get('batch', BATCH) }}
- batch_wait: {{ action.get('batch_wait', BATCH_WAIT) }}
- queue: True
- timeout: {{ STATE_TIMEOUT }}
- require:
- salt: refresh_pillar_{{ loop.index }}
{% endif %}