-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Properly wait on returns in saltnado #48193
Conversation
Thanks for the help with this issues @jacksontj |
salt/netapi/rest_tornado/saltnado.py
Outdated
# Map of minion_id -> returned for all minions we think we need to wait on | ||
minions = {} | ||
for m in pub_data['minions']: | ||
minions[m] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can just do
minions = {minion: False for minion in pub_data['minions']}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gtmanfred oh, did we drop python 2.6 support? IIRC dict comprehension isn't in 2.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, we dropped 2.6 starting with 2017.7.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Squashed those commits, and rebased on current develop (in hopes of fixing some of the CI failures ;) ) |
@jacksontj looks like you definitely fixed the syndic.
We are getting the subminion returning on the saltnado syndic tests, can you add that to the test case? Thanks, |
When I run these locally I get a bunch of failures in the API tests with the |
The localhost minion won't be there if you don't pass |
The tests look good to me now. |
This was broken because the behavior was to simply check the ckminions and wait for only those returns to complete. This works assuming ckminions is accurate (which there are many cases where it isn't, such as syndics). _disbatch_local's waiting on returns needs to match LocalClient's behavior (namely that in get_iter_returns). This means we are allowed to return when (1) we have waitged the min_wait_time (0 if not a syndic) (2) no minions are running the job (3) all minions we saw running it are done running the job. The only method allowed for earlier termination is if the gather_job_timeout is exceeded. Fixes saltstack#42659
Without this option we aren't really a syndic and it won't wait
This was broken because the behavior was to simply check the ckminions
and wait for only those returns to complete. This works assuming
ckminions is accurate (which there are many cases where it isn't, such
as syndics).
_disbatch_local's waiting on returns needs to match LocalClient's
behavior (namely that in get_iter_returns). This means we are allowed to
return when (1) we have waitged the min_wait_time (0 if not a syndic)
(2) no minions are running the job (3) all minions we saw running it are
done running the job. The only method allowed for earlier termination is
if the gather_job_timeout is exceeded.
Fixes #42659
What does this PR do?
What issues does this PR fix or reference?
Previous Behavior
Remove this section if not relevant
New Behavior
Remove this section if not relevant
Tests written?
Yes/No
Commits signed with GPG?
Yes/No
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.