What exactly the timeout do in case of single minion

174 views
Skip to first unread message

Pranav Aggarwal

unread,
Sep 25, 2013, 8:38:19 AM9/25/13
to salt-...@googlegroups.com
I am trying to use Python client API for my deployment? and not able to understand the use of timeout. 

When we run state.highstate , why master returns back with no execution if timeout is not mentioned or set to None


Pranav

Colton Myers

unread,
Sep 25, 2013, 2:52:41 PM9/25/13
to salt-...@googlegroups.com
So if you don't define a timeout, then highstate just returns without running?

Timeout for salt CLI commands (not sure if it's the same for the API or not) define the time the master waits for a return before it checks with the minions to see if they're still running the command.

--
Colton Myers


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Pranav Aggarwal

unread,
Sep 26, 2013, 2:17:37 AM9/26/13
to salt-...@googlegroups.com
Yes it returns without running. This is why i was not able to understand the definition. As per definition you told, it must recheck the minion is working or not, rather it just says it is not working and returns back if no timeout is given. Right?

-- Pranav

Colton Myers

unread,
Sep 26, 2013, 11:48:52 AM9/26/13
to salt-...@googlegroups.com
Are you defining the timeout as None or 0?  Or just not defining, and letting it use its default value?

Your analysis is right, as far as I know, assuming default settings.

--
Colton Myers

Pranav Aggarwal

unread,
Sep 27, 2013, 8:41:17 AM9/27/13
to salt-...@googlegroups.com
i tried it given None and default settings too


-Pranav

Colton Myers

unread,
Sep 27, 2013, 3:15:33 PM9/27/13
to salt-...@googlegroups.com
Can you show the relevant pieces of your Python code?  I want to make sure there's not another problem with your API code that could be causing this.

--
Colton Myers

Pranav Aggarwal

unread,
Oct 1, 2013, 6:27:32 AM10/1/13
to salt-...@googlegroups.com

def bada_salt_call(config , relativedistpath):
    client = salt.client.LocalClient()
    ter = client.cmd('*','test.ping')
    print ter
    pillars = 'pillar={"minion":"%(minion)s","distroot":"bada/%(distroot)s/","dbhost":"%(dbh)s","dbname":"%(dbn)s","dbuser":"%(dbu)s","dbpassword":"%(dbp)s","reportdbname":"%(rdbn)s","reportdbhost":"%(rdbh)s","reportdbuser":"%(rdbu)s","reportdbpassword":"%(rdbp)s","escluster":"%(esc)s"}' % \
   {\
   "minion": confitem('minion'),\
   "distroot": relativedistpath,\
   "dbh": confitem('dbhost'),"dbn": confitem('dbname'),"dbu": confitem('dbuser'),"dbp": confitem('dbpass'),\
   "rdbn": confitem('rdbname'),"rdbh": confitem('rdbhost'),"rdbu": confitem('rdbuser'),"rdbp": confitem('rdbpass'),\
   "esc": confitem('escluster')\
   }
    print 'params passed to salt-depolyemt:' + str(pillars)
    ret = client.cmd('*','state.highstate',[pillars],timeout=6000)
    print ret

Pranav Aggarwal

unread,
Oct 1, 2013, 6:33:19 AM10/1/13
to salt-...@googlegroups.com
Myers, The thing is giving a big value to timeout will increase my problems, as in the case i have to wait until minions responded back and the connection is timed out for further processing.
I have to run casperJS tests to generate the working report. Waiting for unconditional time out is hitting my head. 


-- Pranav

On Saturday, 28 September 2013 00:45:33 UTC+5:30, basepi wrote:

Colton Myers

unread,
Oct 1, 2013, 12:55:57 PM10/1/13
to salt-...@googlegroups.com
Does the highstate run successfully when you run it with the salt CLI, rather than with the python API?

--
Colton Myers

Pranav Aggarwal

unread,
Oct 3, 2013, 2:11:06 AM10/3/13
to salt-...@googlegroups.com
if I dun give time out, it never works on CLI too.

Colton Myers

unread,
Oct 3, 2013, 3:23:59 PM10/3/13
to salt-...@googlegroups.com
OK, so something is up with your configuration or infrastructure.

Can you create an issue on Github?  Please include as much information as possible, including info from this e-mail thread.  Also, it may be related to your states, so if you can gist/pastebin those and put the link in the issue, that would be helpful.

--
Colton Myers
Reply all
Reply to author
Forward
0 new messages