You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vptest01
Command exited with status 0.
=== stdout ===
vptest01
(no stderr)
Time Taken: 13.785
'''
I am trying to run a command, but I dont want to wait for more than 2 seconds. Am I doing something wrong ? Looks like connect_timeout does not work ??
The text was updated successfully, but these errors were encountered:
New here so I may be wrong but by the looks of it, connect_timeout is for TCP connection timeouts ie "I haven't heard back from the server in x seconds". In this case, the client doesn't just send the run command and waits 10 seconds without hearing anything from the server. Instead, the client sends a run request, the server acknowledges the run request, and then at a later point initiates the return transmission. The client doesn't ever sit without a reply for 2 seconds in a normal scenario with good connection to the server.
You might want to have a look at the timeout utility.
Again, new here so take everything I've said with a grain of salt until someone else can vouch for it :)
Thanks @dhdavvie. @bitprophet actually advised to use connect_timeout in another thread #762 ...It was a year ago so I opened a new one :(
Am stuck in this part were the FS gets full, fabric2 thread throws below given prompt and then this just sits there forever blocking the main thread.
Sorry, I am also a novice and I believe am doing something wrong in fabric2 as it used to work fine in fabric
]: fabric2:runCommand: '/bin/ksh -c . ~/.profile ; unzip packages/somepath/*.zip -d packages/somepath/' is being executed on: xxxx@xxxx:22.Retries Left: 3
]:inflating: packages/somepath/something.ear
]: packages/somepath/something.ear: write error (disk full?). Continue? (y/n/^C)
timeout is nice :) .But is there something in python that I can club with fabric2 to achieve this
from datetime import datetime
from fabric2 import connection
start = datetime.now()
connect = connection.Connection(host="root@vptest01",
connect_kwargs={"password": "somepass"},
gateway=None,
connect_timeout=2)
print connect.run("sleep 10 && hostname", warn=True, shell="/bin/bash -c", pty=False)
print "Time Taken: "+ str((datetime.now()-start).total_seconds())
'''
Output:
vptest01
Command exited with status 0.
=== stdout ===
vptest01
(no stderr)
Time Taken: 13.785
'''
I am trying to run a command, but I dont want to wait for more than 2 seconds. Am I doing something wrong ? Looks like connect_timeout does not work ??
The text was updated successfully, but these errors were encountered: