SSHOperator ignores cmd_timeout
See original GitHub issueApache Airflow Provider(s)
ssh
Versions of Apache Airflow Providers
No response
Apache Airflow version
2.4.1
Operating System
linux
Deployment
Other
Deployment details
No response
What happened
Hi,
SSHOperator documentation states that we should be using cmd_timeout instead of timeout
:param timeout: (deprecated) timeout (in seconds) for executing the command. The default is 10 seconds.
Use conn_timeout and cmd_timeout parameters instead.
But the code doesn’t use cmd_timeout at all - and it’s still passing self.timeout
when running the ssh command:
return self.ssh_hook.exec_ssh_client_command(
ssh_client, command, timeout=self.timeout, environment=self.environment, get_pty=self.get_pty
)
It seems to me that we should self.cmd_timeout
here instead. When creating the hook, it correctly uses self.conn_timeout
.
I’ll try to work on a PR for this.
What you think should happen instead
No response
How to reproduce
No response
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
SSH operator error: timed out in Airflow while connecting with ...
The problem is solved, actually, the port number 8888 was incorrect. It worked with port number 22.
Read more >SqlCommand.CommandTimeout is being ignored - MSDN
I am getting the following exception because of what appears to be SQL command timeout issue: System.Data.SqlClient.
Read more >[airflow] branch main updated: Refactor SSHOperator so a ...
[airflow] branch main updated: Refactor SSHOperator so a subclass can ... + self.log.info("ssh_conn_id is ignored when ssh_hook is provided.
Read more >Source code for airflow.contrib.operators.ssh_operator
[docs]class SSHOperator(BaseOperator): """ SSHOperator to execute commands on given remote host using the ssh_hook. :param ssh_hook: predefined ssh_hook to ...
Read more >SSH Connection - Apache Airflow Documentation
The SSH connection type provides connection to use SSHHook to run commands on a remote server using SSHOperator or transfer file from/to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok done - I updated the PR and fix/added tests.
Right, i’ll give it a try an update the above PR