ktmud commented on a change in pull request #7088: [WIP][AIRFLOW-6494] SSH 
host_proxy has to be fresh
URL: https://github.com/apache/airflow/pull/7088#discussion_r367582852
 
 

 ##########
 File path: airflow/contrib/hooks/ssh_hook.py
 ##########
 @@ -171,6 +171,13 @@ def get_conn(self) -> paramiko.SSHClient:
                              'against Man-In-The-Middle attacks')
             # Default is RejectPolicy
             client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+
+        # restart host_proxy to avoid "Broken Pipe" error
+        if getattr(self, 'host_proxy') is not None:
+            if not self.host_proxy.closed:
+                self.host_proxy.close()
 
 Review comment:
   HostProxy (Paramiko's ProxyCommand) is basically a subprocess. Closing of 
proxy socket does not mean subprocess is closed. This is for making sure 
subprocess is also closed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to