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

infinite loop on minion #5623

Closed
Mrten opened this issue Jun 19, 2013 · 4 comments
Closed

infinite loop on minion #5623

Mrten opened this issue Jun 19, 2013 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior
Milestone

Comments

@Mrten
Copy link
Contributor

Mrten commented Jun 19, 2013

This easy state throws the minion into an infinite loop:

#!mako|yaml

include:
  - machine.web.users

<%

out = salt['state.show_lowstate']()
root@svn:/home/mrten# pstree
init─┬─acpid
     ├─salt-minion───118*[{salt-minion}]
@basepi
Copy link
Contributor

basepi commented Jun 19, 2013

Hrm, that's odd. Thanks for the report!

@basepi
Copy link
Contributor

basepi commented Jun 20, 2013

I'm not exactly sure what you're trying to accomplish with this state, but trying to call a state function (state.show_lowstate) from a state is generally going to throw an infinite loop -- it tries to compile the state, calls the lowstate, which tries to compile the state, which calls the lowstate......

I don't think this is a bug, unless I'm missing something.

@Mrten
Copy link
Contributor Author

Mrten commented Jun 20, 2013

I am trying to solve this without code duplication:
https://groups.google.com/forum/#!topic/salt-users/aLmfXsneyjU

Nevertheless; show_lowstate should at least try to detect that there is a state being compiled at the moment and then return false or something to prevent what basically amounts to a fork-bomb.

It could also try to return already collected states and could then be useful for my application.

@basepi
Copy link
Contributor

basepi commented Jun 20, 2013

Hrm, interesting. I agree that it would be good to restrict access there, though I'm not sure it will be easy to make the distinction as to whether we're compiling a state or another template.

I'll ask @thatch45 about it.

@basepi basepi closed this as completed in 74269ab Aug 7, 2013
thatch45 added a commit that referenced this issue Aug 7, 2013
Don't run functions that compile states inside of states, Fix #5623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior
Projects
None yet
Development

No branches or pull requests

2 participants