Skip to content
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

[3006.x] Fix batch mode hang indefinitely in some scenarios #66758

Merged
merged 4 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/66249.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix batch mode hang indefinitely in some scenarios
12 changes: 10 additions & 2 deletions salt/cli/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ def gather_minions(self):
)
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):
Expand Down Expand Up @@ -292,11 +299,12 @@ def run(self):
# 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.
Expand Down
Loading