potiuk commented on code in PR #40377:
URL: https://github.com/apache/airflow/pull/40377#discussion_r1650317715


##########
airflow/providers/ssh/operators/ssh.py:
##########
@@ -198,3 +198,9 @@ def tunnel(self) -> None:
         """Get ssh tunnel."""
         ssh_client = self.hook.get_conn()  # type: ignore[union-attr]
         ssh_client.get_transport()
+
+    def on_kill(self) -> None:
+        """Close the ssh client session."""
+        ssh_client = self.hook.get_conn()

Review Comment:
   It's not the same - it turns `get_conn()` into `get_conn` property which is 
not what we want - it won't change caching when you directly call get_conn() 
method, which is what we do in a few places.
   
   Look at other hooks (find `def get_conn(` in other files - we usually do `if 
self.client: return self.client` kind of approach there.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to