mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix batch mode hang indefinitely in some scenarios - unit tests to follow
This commit is contained in:
parent
17dcfa29fd
commit
6d10c20ea8
2 changed files with 11 additions and 2 deletions
1
changelog/66249.fixed.md
Normal file
1
changelog/66249.fixed.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix batch mode hang indefinitely in some scenarios
|
|
@ -83,7 +83,14 @@ class Batch:
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
if m is not None:
|
if m is not None:
|
||||||
fret.add(m)
|
if "failed" in ret[m] and ret[m]["failed"] is True:
|
||||||
|
log.debug(
|
||||||
|
"minion '%s' failed test.ping - will be returned as a down minion",
|
||||||
|
m,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
fret.add(m)
|
||||||
|
|
||||||
return (list(fret), ping_gen, nret.difference(fret))
|
return (list(fret), ping_gen, nret.difference(fret))
|
||||||
|
|
||||||
def get_bnum(self):
|
def get_bnum(self):
|
||||||
|
@ -292,11 +299,12 @@ class Batch:
|
||||||
# We already know some minions didn't respond to the ping, so inform
|
# We already know some minions didn't respond to the ping, so inform
|
||||||
# inform user attempt to run a job failed
|
# inform user attempt to run a job failed
|
||||||
salt.utils.stringutils.print_cli(
|
salt.utils.stringutils.print_cli(
|
||||||
"Minion '%s' failed to respond to job sent", minion
|
f"Minion '{minion}' failed to respond to job sent"
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.opts.get("failhard"):
|
if self.opts.get("failhard"):
|
||||||
failhard = True
|
failhard = True
|
||||||
|
ret[minion] = data
|
||||||
else:
|
else:
|
||||||
# If we are executing multiple modules with the same cmd,
|
# If we are executing multiple modules with the same cmd,
|
||||||
# We use the highest retcode.
|
# We use the highest retcode.
|
||||||
|
|
Loading…
Add table
Reference in a new issue