Repository navigation
Conversation
Motivation: check_prior_running_states() treats every running state.* job with a PID as blocking regardless of JID order. A job waiting in the queue=<int> path (state._wait) is itself a running job with a PID, so once the first run finishes, the remaining two waiting jobs block on each other forever. Two concurrent runs are unaffected; three or more deadlock. Approach: a running job that has a queue flag file (written by state._set_queue_flag and removed before the state run starts) is treated like a queued placeholder: it blocks only jobs with a higher JID. Jobs without a flag keep blocking unconditionally, preserving the behaviour added for the concurrent-run race. Validation: added a unit test with two waiting jobs and flag files. It fails without the change and passes with it. Ran `pytest tests/pytests/unit/modules/state/test_state.py tests/pytests/unit/utils/test_state.py` (68 passed). The end-to-end multi-job reproduction on a live minion was not run here. Report: saltstack#70580 Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
twangboy
requested changes
Oct 30, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a deadlock in check_prior_running_states() where three or more simultaneous state runs with queue= wait on each other forever. A running job that has a queue flag file is treated as waiting and blocks only higher JIDs.
What issues does this PR fix or reference?
Fixes #70580
Previous Behavior
With three simultaneous queue= runs, after the first finishes the other two block on each other indefinitely.
New Behavior
Waiting jobs only block younger jobs, so runs execute in JID order.
Merge requirements satisfied?
Commits signed with GPG?
No (DCO sign-off only)
This PR was written in part with the assistance of generative AI.
Fixes #70580