Reactor cmd/local infinite recursion
If you configure the reactor to run on any event that is generated by firing a job to a minion (job ret, job pub, etc.) then the reactor will infinitely recurse on itself. This is because the cmd_async function (which it uses for firing the job to the minion) has no mechanism to disable firing an event-- meaning the reactor will react on events that originated from the reactor.
Thanks for reporting this. What version of salt are you running? I believe @cachedout has made recent asynchronous changes to the reactor. You may even know more about this than me.
This is reproducible in all versions of salt AFAIK (confirmed on 2014.7 and current develop).
This isn't so much a break as a design flaw ;) I had added some code in the past to not fire event (74b20cf), but this wasn't fixed for the cmd/local clients-- because there is no API to ask salt to not publish events (or have the reactor ignore them).
The more I think about this I don't like the not firing events option. I'm thinking we either add another field to the event, or just always pass user="reactor" and just filter out all reactor events in the reactor.
With the work I was doing over in the runners, I remembered this and it turns out that after the changes I made this is actually quite simple. The fix i have doesn't stop you from catching all events, but it does stop infinite recursion.
@jacksontj Are you still working on this or can we close this?
The specific case of returner in the reactor is fixed, but the other ones (local cmd etc.) are still an issue, which we still need to fix
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
I don't see the rationale for adding
"user":"Reactor" as event field and not gathering reactors for such.
Actually I do want to start e.g. orchestration via Reactor
and do some cleanup actions after it completes.
Aforementioned orchestration completes with one clean event
salt/run/20180104200542718042/ret that I would like to match on
Unfortunately I cannot because of "user":"Runner"
How can I attach reactors for the event of completion of reactor:
start_orchestration:
runner.state.orchestrate:
- args:
- mods: _orchestrate.dummy.action
- pillar:
targets: {{ data['minions'] }}
- saltenv: {{ saltenv }}