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
In some cases, such as when the remote command never terminates unless interrupted, it is necessary to use PTY and to close the channel to force the process to be terminated before a ``join`` sans timeout can complete. For example:
# Join is not strictly needed here as channel has already been closed and
207
+
# command has finished, but is safe to use regardless.
193
208
client.join(output)
194
209
195
-
Without a PTY, the ``join`` will complete but the remote process will be left running as per SSH protocol specifications.
210
+
Without a PTY, a ``join`` call with a timeout will complete with timeout exception raised but the remote process will be left running as per SSH protocol specifications.
196
211
197
212
Furthermore, once reading output has timed out, it is necessary to restart the output generators as by Python design they only iterate once. This can be done as follows:
198
213
@@ -205,7 +220,7 @@ Furthermore, once reading output has timed out, it is necessary to restart the o
205
220
except Timeout:
206
221
client.reset_output_generators(host_out)
207
222
208
-
Generator reset shown above is also performed automatically by calls to ``join`` and does not need to be done manually ``join`` is used after output reading.
223
+
Generator reset shown above is also performed automatically by calls to ``join`` and does not need to be done manually when ``join`` is used after output reading.
0 commit comments