Skip to content

Use single JID for entire batch run#68941

Merged
dwoz merged 2 commits intosaltstack:masterfrom
dwoz:batching
Apr 16, 2026
Merged

Use single JID for entire batch run#68941
dwoz merged 2 commits intosaltstack:masterfrom
dwoz:batching

Conversation

@dwoz
Copy link
Copy Markdown
Contributor

@dwoz dwoz commented Apr 15, 2026

Batch mode previously generated a separate JID per batch iteration, making it impossible to track a batch operation as a single job via salt-run jobs.lookup_jid. Generate one JID at the start of batch.run() and pass it to every cmd_iter_no_block call so all iterations share it.

In local_cache.save_minions(), change from overwrite to read-merge-write so that each batch iteration accumulates its minion list under the shared JID rather than replacing the previous iteration's list.

In client.cmd_iter_no_block(), filter the jid kwarg before passing to get_iter_returns to avoid conflicting with its positional jid argument.

Fixes #25362, #58502

@dwoz dwoz requested a review from a team as a code owner April 15, 2026 07:33
@dwoz dwoz added the test:full Run the full test suite label Apr 15, 2026
Batch mode previously generated a separate JID per batch iteration,
making it impossible to track a batch operation as a single job via
salt-run jobs.lookup_jid. Generate one JID at the start of batch.run()
and pass it to every cmd_iter_no_block call so all iterations share it.

In local_cache.save_minions(), change from overwrite to read-merge-write
so that each batch iteration accumulates its minion list under the shared
JID rather than replacing the previous iteration's list.

In client.cmd_iter_no_block(), filter the jid kwarg before passing to
get_iter_returns to avoid conflicting with its positional jid argument.

Fixes saltstack#25362, saltstack#58502
@dwoz dwoz merged commit 23e87d6 into saltstack:master Apr 16, 2026
864 of 869 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI options "--async" and "--batch-size" are not compatible.

2 participants