You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2024/06/23 18:49:10 UTC
Re: [PR] Add on kill to ssh [airflow]
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org