Skip to content

Fix minion status tracking for direct state.apply dispatches - #1

Open
avinashbhatv wants to merge 2 commits into
saltstack:mainfrom
avinashbhatv:fix/minion-status-tracking
Open

Fix minion status tracking for direct state.apply dispatches#1
avinashbhatv wants to merge 2 commits into
saltstack:mainfrom
avinashbhatv:fix/minion-status-tracking

Conversation

@avinashbhatv

Copy link
Copy Markdown

Ports commit 462f8f14f from the internal fork.

Fixes scc run/scc deploy/scc job-status hanging or reporting stale status for jids dispatched via a direct cmd.route_cmd call (not a tracked RaaS Job entity) — cmd.get_cmd_status never reports "complete" for those, so:

  • _wait_for_job/_wait_for_job_live now also complete once ret.get_returns has a result for every targeted minion (when the target is a list-type target with a known member count), independent of the RaaS job-status flag.
  • job-status falls back to ret.get_returns when the status registry reports something unrecognized (e.g. not-found) instead of giving up.

Verified against a live RaaS/vCenter environment: both dry-run and apply now return control immediately after the minion reports, instead of hanging until the 1800s timeout.

Comment thread salt_config_cli/cli/main.py Outdated
if expected_minions:
try:
returns_resp = api_client.call("ret", "get_returns", jid=jid)
except Exception:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific exception or class of exception we can expect here? In general "bare exception" catching is frowned upon.

@avinashbhatv avinashbhatv Aug 7, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch , it doesnt need to be this broad. api_client.call() raises salt_config_cli.api.exceptions.APIError (or one of its subclasses : ConnectionError, TimeoutError, AuthenticationError, ServerError) for anything RPC-related. I'll narrow it to:

except APIError:

Per review feedback on PR saltstack#1: api_client.call() raises
salt_config_cli.api.exceptions.APIError (or a subclass -- ConnectionError,
TimeoutError, AuthenticationError, ServerError) for anything RPC-related.
These polling checks are best-effort/supplementary (the loop falls back to
its primary completion signal either way), so catching the client's own
known error types is correct, but a bare except Exception was needlessly
broad and would also swallow real bugs (e.g. a TypeError from a malformed
response) silently.
@avinashbhatv
avinashbhatv requested a review from dwoz August 7, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants