saltstack/salt — pull request #14064 by steverweber (2014-07-09 20:40:45+00:00)
Title: change to thread mode

My previous attempt to fix the auto restart was not stable.
There was memory leak(s).

This solution puts the minion instance into a thread. All memory / file handlers are easy to cleanup.

The root cause of the issue dont seem to have a simple solution.
Part of the issue is in the MixIn parse_args it was not built for reruns.
_mixin_after_parsed_funcs will grow on each minion creation...

There also seems to be some issues with the minion.scheduler building up file handlers...

I'm not a fan of forcing minion.start() into a new thread... but this seems to be solid.
I'll preform some more tests but feedback is most welcome.

Thanks