-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout is ambiguous in SSHHook and SSHOperator #16364
Comments
I feel Option 2 is clearer regardless, since it is still quite confusing if
|
Agree and I think point 4. should not be optional. We should deprecate it. One more thing - I noticed that "timeout" (among others) options for sshHook which also should be updated:
I though also that we could convert the SSHHook to be configurable via UI changing the I think it's not worth for this change, but we should probably reimplement the way the extra UI fields are defined to support inheritance better. |
@ashb See ^^ I think you mentioned you had some idea that we should get rid of the |
@potiuk Yeah, I always just found it annoying to have the prefix on it, mostly when setting the connection via a URI. Are you saying this issue means we should keep the prefix, or you would like to remove it too? |
SSH/SFTP does not have the prefix (it does not support UI fields for extras). Since long term remove the prefix (I agree it's annoying)- we should not touch it here then and keep it without the prefix and implement removal of the prefix later (and then we can add UI support for SSH/SFTP). So summarizing @NBardelot : just don't forget to add the "cmd_timeout" and "conn_timeout" to extras (without prefix). |
Do we need |
I think both should be in Hook/connection - acting as default value for all SSH commands. It could be done via dag defaults as well, but both "cmd_timeout" and "timeout" are a bit too generic IMHO for Dag defaults, so it would have to be "ssh_command_timeout" or something like tha. In this case, it rather belongs to connection. |
Please! |
Just to be clear on the preferred usage going forward:
It doesn't seem to make sense to accept a cmd_timeout in the hook, so I am planning to do the following:
|
Sounds reasonable to me. You’ll also need to keep the |
Thanks, @uranusjr. For the deprecation warning, is it fair to warn that it will be removed in a future version without specifying the exact one? |
Yes; you can search for |
@jayam26 Not sure what was your goal here. If you see an issue with using the timeouts, commenting here with such statement. makes very little sense if you want help - I suggsest you start a discussion with providing some more things you tried and failed and ask what you want help with. But you need to start with explaining the details (and don't do it in the closed issue - you might refer to it if you want to refer to somethign discussed here. |
In SSHHook the timeout argument of the constructor is used to set a connection timeout. This is fine.
But in SSHOperator the timeout argument of the constructor is used for both the timeout of the SSHHook and the timeout of the command itself (see paramiko's ssh client exec_command use of the timeout parameter). This ambiguous use of the same parameter is very dirty.
I see two ways to clean the behaviour:
The choice between 1 and 2 depends on how frequently people are supposed to want to change the connection timeout. If it is something very frequent. then go for 2. if not go for 1.
BR and thanks for the code!
The text was updated successfully, but these errors were encountered: