Repository navigation
Closed
Labels
ConfirmedSalt engineer has confirmed bug/feature - often including a MCVECorerelates to code central or existential to SaltP4Priority 4Runnersbugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-high2nd top severity, seen by most users, causes major problems
Milestone
Description
Hi all,
with 2015.2.0rc2
I have the following reactor sls that calls an orchestrate runner:
{% set fun = data.get('fun', {}) %}
{% set id = data.get('id', {}) %}
{% if fun == "test.ping" %}
orchestrate_test_{{id}}:
runner.state.orchestrate:
- mods: orchestration.test
- pillar: { target_server: {{id}} }
{% endif %}When running test.ping on multiple minions (3 in this case)
the reactor sls is rendered fine 3 times :
2015-05-05 15:52:40,038 [salt.template ][DEBUG ][25815] Rendered data from file: /srv/salt/base/reactor/jobs_ret.sls:
orchestrate_test_minion1:
runner.state.orchestrate:
- mods: orchestration.test
- pillar: { target_server: minion1 }2015-05-05 15:52:40,128 [salt.template ][DEBUG ][25815] Rendered data from file: /srv/salt/base/reactor/jobs_ret.sls:
orchestrate_test_minion2:
runner.state.orchestrate:
- mods: orchestration.test
- pillar: { target_server: minion2 }2015-05-05 15:52:40,261 [salt.template ][DEBUG ][25815] Rendered data from file: /srv/salt/base/reactor/jobs_ret.sls:
orchestrate_test_minion3:
runner.state.orchestrate:
- mods: orchestration.test
- pillar: { target_server: minion3 }however, the orchestrate runners will not always get the correct pillar data (it will sometimes get an empty value, sometimes an other orchestrate runner's pillar data, sometimes the expected value) :
The orchestrate sls:
{% set tgs = salt['pillar.get']('target_server') %}
test:
salt.function:
- name: test.arg
- tgt: {{ tgs }}2015-05-05 15:52:45,024 [salt.template ][DEBUG ][25815] Rendered data from file: /var/cache/salt/master/files/base/orchestration/test.sls:
test:
salt.function:
- name: test.arg
- tgt: minion12015-05-05 15:52:45,025 [salt.template ][DEBUG ][25815] Rendered data from file: /var/cache/salt/master/files/base/orchestration/test.sls:
test:
salt.function:
- name: test.arg
- tgt: minion12015-05-05 15:52:45,275 [salt.template ][DEBUG ][25815] Rendered data from file: /var/cache/salt/master/files/base/orchestration/test.sls:
test:
salt.function:
- name: test.arg
- tgt: minion3There are also sometimes some RuntimeError: Set changed size during iteration exceptions raised such as:
2015-05-05 15:52:48,917 [salt.loader ][ERROR ][25815] Failed to read the virtual function for states: xmpp
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/loader.py", line 1098, in process_virtual
virtual = mod.__virtual__()
File "/usr/lib/python2.6/site-packages/salt/states/xmpp.py", line 25, in __virtual__
return 'xmpp' if 'xmpp.send_msg' in __salt__ else False
File "/usr/lib64/python2.6/_abcoll.py", line 342, in __contains__
self[key]
File "/usr/lib/python2.6/site-packages/salt/utils/lazy.py", line 85, in __getitem__
if self._load(key):
File "/usr/lib/python2.6/site-packages/salt/loader.py", line 1024, in _load
ret = _inner_load(mod_name)
File "/usr/lib/python2.6/site-packages/salt/loader.py", line 1013, in _inner_load
if self._load_module(name) and key in self._dict:
File "/usr/lib/python2.6/site-packages/salt/loader.py", line 990, in _load_module
Depends.enforce_dependencies(self._dict, self.tag)
File "/usr/lib/python2.6/site-packages/salt/utils/decorators/__init__.py", line 81, in enforce_dependencies
for module, func, fallback_function in dependent_set:
RuntimeError: Set changed size during iterationMetadata
Metadata
Assignees
Labels
ConfirmedSalt engineer has confirmed bug/feature - often including a MCVECorerelates to code central or existential to SaltP4Priority 4Runnersbugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-high2nd top severity, seen by most users, causes major problems
Activity
jfindlay commentedon May 6, 2015
@tnypex, thanks for the report.
cachedout commentedon May 6, 2015
My first thought here is that we might be hitting an issue with threading in the reactor, though it doesn't quite seem clear how that might be affecting things. We'll need to carefully step through the code here to see what's happening.
cachedout commentedon May 6, 2015
@tnypex There should be some lines in your debug log that start with
ThreadPool executing func: .... Can you paste those? They'll be right after those rendering lines you already pasted.tnypex commentedon May 7, 2015
Here they are:
tnypex commentedon May 7, 2015
I don't really know what I am doing :), but it looks like the following fixes this issue.
Maybe it will ring some bells
Added exception handler to trap the RuntimeError raised when
32 remaining items
cachedout commentedon Nov 19, 2015
We didn't hear back here, so I'm going to go ahead and close this since it does appear to be fixed. If not, please leave a comment here and we'll happily re-open it.
tnypex commentedon Nov 26, 2015
Hi,
Sorry for the delay, I tested from develop but the issue is still present in orchestrate runners started by the reactor.
DmitryKuzmenko commentedon Dec 1, 2015
@jacksontj will you look at this or I should take care?
jacksontj commentedon Dec 3, 2015
From my local testing I can't reproduce the same changed size during iteration error, but I do run into some issues getting your SLSs to run. The first one seems to be an oddity with pillar.get from jinja. For example, with the following SLS:
if "target_server" is not in the pillar, I'd expect it to come back as None or empty string-- but for some reason its coming back as an empty dict and I'm getting exceptions like:
Although that looks ugly-- its not actually whats broken. After looking some more I see that the minion is throwing an exception:
Which means its choking on the pub job. I added some prints and it seems that the pub job looks like:
And 'ret' is definitely not valid (its supposed to be returners in the pub job, not the return). After tracking that down I found that there was some variable shadowing in states.saltmod (d968d69).
I've opened a PR with fixes (#29397) can you try with that? And if you do still see issues, mind pasting logs/errors/tracebacks as well?
Merge pull request #29397 from jacksontj/concurrent
cachedout commentedon Dec 23, 2015
Since we have a fix in and no reply, I am closing this. If it turns out not to be fixed, please comment and we will re-open this.
tnypex commentedon Jan 12, 2016
Hi,
Sorry I should have been more precise on the issue that remains, from the develop branch I still experience mixed up pillar data in orchestrate runners started by the reactor (no more tracebacks).
the reactor sls is:
and the orchestrate sls:
When, run test.ping against multiple minions
salt '*' test.ping, the reactor sls is correctly rendered but the following orchestrate runners get mixed/inconsistent pillar data, full debug logs pasted below:basepi commentedon Jan 12, 2016
@tnypex I'm thinking that since we've fixed part of this issue we should open a new issue for the remaining piece and link back to this issue, so "what's left" is clearer. Thoughts?
Fix grains and pillars in salt-ssh