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


##########
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:
   I think we also need to add  caching to `get_conn` - otherwise every call to 
get_conn() retrieves a new client



-- 
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