You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/27 18:40:40 UTC

[GitHub] [airflow] o-nikolas commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

o-nikolas commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1007236645


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   I think you need to check if **all** three results are empty to be sure a timeout has occurred. Useful link: https://stackoverflow.com/a/15195460/1055702



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org