Skip to content

Possible to separately specify connect_timeout and read_timeout? #281

Answered by pkittenis
gjd6640 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Thanks for the interest.

That is already possible via, for example:

client = ParallelSSHClient(<..>, timeout=1)
client.run_command(<..>, stop_on_errors=False)
client.join(timeout=60)

The above should cause connection attempts to timeout in one second and wait for successful remote commands (ie, excluding ones that timed out) to finish for up to sixty seconds.

Read timeout, as in reading from stdout/stderr, is separate and can be set via run_command(<..>, read_timeout=N). It is per stream, meaning separate timeout for each of stdout/stderr on each host whereas join timeout is cumulative for all remote commands.

Can you show example code of what you are trying to do, if not covered by …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pkittenis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants