salt icon indicating copy to clipboard operation
salt copied to clipboard

salt minion hangs when sign_in

Open ultraice opened this issue 12 years ago • 11 comments

https://github.com/saltstack/salt/issues/4199#issuecomment-37623714 I met the problem too. many minions works well, only one hangs, and minion hog cpu to 100%

After starting the salt minion, it auto scheduled mine.update, and the cpu went 100% I can avoid this by tuning multiprocessing to false, and everything works fine.

I straced minion, it was busy epoll_wait, which returned 1. " SaltReqTimeoutError: Waited 60 seconds" was logged, I thought it was throwed from sign_in

Tried publish command from the master, minion did excute the job, but nothing returned to master. tcpdump the 4506 port returns nothing

master and minion has the same version: Salt: 0.17.5 Python: 2.7.2 (default, Dec 26 2013, 13:19:58) Jinja2: 2.7.2 M2Crypto: 0.22 msgpack-python: 0.4.0 msgpack-pure: Not Installed pycrypto: 2.6.1 PyYAML: 3.10 PyZMQ: 14.0.1 ZMQ: 4.0.3

ultraice avatar Mar 14 '14 09:03 ultraice

Only the one minion hangs? What OS is on that minion?

basepi avatar Mar 17 '14 21:03 basepi

yes, only minion hangs. It is SuSE with customized kernel.

ultraice avatar Apr 21 '14 13:04 ultraice

Very strange. For now, I would recommend turning off multiprocessing, as you mentioned before. We'll have to see if we can reproduce ourselves.

basepi avatar Apr 21 '14 19:04 basepi

ok thanks. After I just designed a job control infrastructure, I found salt, It is just what I need. Salt is a great work.

and I think because salt used zmq, it must pull the result and it is not like a push server. if the minion keeps connecting with a push server, the job scheduler could immediately fail the unconnected minion job.

ultraice avatar Apr 24 '14 03:04 ultraice

The minion stays connected to the master, and the master pushes jobs to the minion. The minion can also pull stuff from the master when it wants to, but most of salt is push-based.

basepi avatar Apr 24 '14 22:04 basepi

For example, if minion A is down, I try to push a job to minion A, the master will return immediately or wait timeout?

ultraice avatar May 07 '14 03:05 ultraice

The master will wait for the timeout. Currently the master doesn't keep much information on which minions are actually currently connected, it decides which minions exist based on accepted keys. So if you target minion_a, then the master will look for an accepted key for minion_a, find it, fire the job, and then wait for the return.

basepi avatar May 07 '14 16:05 basepi

So if zmq provide the interface to query the connected minons, the master needn't to wait for the timeout.

ultraice avatar May 08 '14 03:05 ultraice

The problem is that it's a pub-sub model. The master fires off the job to all connected minions, then waits for the minions it expects to return. It doesn't know who received the job.

We do now have presence events that allow us to see which minions are connected and which aren't. However, we do not currently store that information and have not yet incorporated it into the targeting system. It's on the list of things we want to do.

basepi avatar May 08 '14 17:05 basepi

Nice! I prefer the master-minion works like the pushsvr( think about APNS push ), and deploying job works like RPC call.

ultraice avatar May 12 '14 07:05 ultraice

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.

stale[bot] avatar Dec 04 '17 22:12 stale[bot]