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

runners.state.orch: generate jid if missing #49759

Merged
merged 3 commits into from
Sep 26, 2018

Conversation

mattp-
Copy link
Contributor

@mattp- mattp- commented Sep 24, 2018

What does this PR do?

via salt-run cli a jid is generated in RunnerClient via gen_async_pub and passed on via orchestration_jid if the func is orchestration, but in other callsites this jid generation doesn't happen (ie, the netapi client, since it directly invokes AsyncMixins.cmd_sync). There seems to be no obvious way to correct this at the netapi level so we just default to a new jid if orch_jid is missing. there may be other calling contexts where this could have been occurring.

What issues does this PR fix or reference?

n/a

Previous Behavior

nested / parallel orchestrations called from salt-api failed/threw a stacktrace resulting from a missing jid like:

  File \"/home/mphillips81/repos/salt/salt/client/mixins.py\", line 374, in low
    data['return'] = func(*args, **kwargs)
  File \"/home/mphillips81/repos/salt/salt/runners/state.py\", line 123, in orchestrate
    orchestration_jid=orchestration_jid)
  File \"/home/mphillips81/repos/salt/salt/modules/state.py\", line 1326, in sls
    ret = st_.state.call_high(high_, orchestration_jid)
  File \"/home/mphillips81/repos/salt/salt/state.py\", line 2789, in call_high
    ret = self.call_chunks(chunks)
  File \"/home/mphillips81/repos/salt/salt/state.py\", line 2159, in call_chunks
    if self.reconcile_procs(running):
  File \"/home/mphillips81/repos/salt/salt/state.py\", line 2232, in reconcile_procs
    ret_cache = os.path.join(self.opts['cachedir'], self.jid, _clean_tag(tag))
  File \"/home/mphillips81/.pyenv/versions/2.7.14/lib/python2.7/posixpath.py\", line 68, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

New Behavior

they work, as a jid is always generated.

Tests written?

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.

via salt-run cli a jid is generated in RunnerClient via gen_async_pub
and passed on via orchestration_jid if the func is orchestration, but in
other callsites this jid generation doesn't happen (ie, the netapi client,
since it directly invokes AsyncMixins.cmd_sync). There seems to be no
obvious way to correct this at the netapi level so we just default to
a new jid if orch_jid is missing. there may be other calling contexts
where this could have been occurring.
@mattp- mattp- changed the title state.orch: generate jid if missing runners.state.orch: generate jid if missing Sep 24, 2018
@gtmanfred gtmanfred added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label Sep 24, 2018
Copy link
Contributor

@cachedout cachedout left a comment

Choose a reason for hiding this comment

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

Very nice.

@rallytime rallytime merged commit 3c488a8 into saltstack:develop Sep 26, 2018
@rallytime rallytime added ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch. and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels Sep 26, 2018
rallytime pushed a commit that referenced this pull request Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants