-
Notifications
You must be signed in to change notification settings - Fork 151
client.join() with timeout throws an exception whether the timeout was reached or not #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can confirm this behavior as well. I have scratched quite a bit of time on this :( |
Hi there, Thank you for the interest and report. Confirmed - this occurs when there is unread output and timeout is used. As a work-around, read buffers prior to calling From further testing, there are cases where a join with a timeout will return immediately while commands are still running. These seem to be unavoidable as timeout is passed on to the However, as that fails when buffers have not been read, and reading buffers can be subject to same timeout, a Eg, consider this code:
On the call to However, after the first join call not all commands have finished which is misleading. This code, on the other hand:
Ensures all commands have finished as buffers are read and |
…ed raising timeout on native client wait_finished.
Updated documentation, changelog. Resolves #104.
There is also some documentation on this functionality and possible race conditions. Sorry for the issues you have been facing with this feature. Please do report any other issues you may face. |
Uh oh!
There was an error while loading. Please reload this page.
Steps to reproduce:
Run the following snippet, after assigning values to
host_lst
,username
andpassword
variablesExpected behaviour:
No exception was supposed to be thrown as the command completes successfully in the allotted time
Actual behaviour:
Timeout
exception was thrownAdditional info:
From what I see the bug results from the following
if
statement (line 219 in pssh2_client.py):As far as I see,
output[host].channel.eof()
isFalse
when the command finishes to run thus the condition evaluates asTrue
and an exception is thrown.The only time that I see that
output[host].channel.eof()
isTrue
is after the output was consumed.The text was updated successfully, but these errors were encountered: