Fix batch mode hang indefinitely in some scenarios - unit tests to follow

This commit is contained in:
David Murphy 2024-07-29 16:14:45 -06:00 committed by Daniel Wozniak
parent 17dcfa29fd
commit 6d10c20ea8
2 changed files with 11 additions and 2 deletions

1
changelog/66249.fixed.md Normal file
View file

@ -0,0 +1 @@
Fix batch mode hang indefinitely in some scenarios

View file

@ -83,7 +83,14 @@ class Batch:
)
break
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))
def get_bnum(self):
@ -292,11 +299,12 @@ class Batch:
# We already know some minions didn't respond to the ping, so inform
# inform user attempt to run a job failed
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"):
failhard = True
ret[minion] = data
else:
# If we are executing multiple modules with the same cmd,
# We use the highest retcode.