apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
35.62k stars 13.87k forks source link

Add on_kill to SSHOperator #40343

Closed potiuk closed 1 day ago

potiuk commented 1 month ago

Body

The SSHOperator does not have on_kill method which could deliberately close the ssh client. This means that the klient is close by TERM or even KILL signal when the task is closed and it might leave the connection to SSH still open for quite some time when the server might not realise that the client is closed.

Closing the client gently should improve the speed with which the SSH server will close such stale connections in most cases.

Committer

vatsrahul1001 commented 1 month ago

@potiuk can I take this up?

MRLab12 commented 1 month ago

I had started some work on this and did not noticed it was assigned. Happy to hand it off if someone else is already working on it.

vatsrahul1001 commented 1 month ago

@MRLab12 go for it if you already have started on this

MRLab12 commented 1 month ago

@vatsrahul1001 Thanks!

@potiuk I opened that draft PR to get an idea of where this new on_kill method should be used or if the idea is to just let the user call it when they need it.