You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/21 12:54:55 UTC

[GitHub] [airflow] punx120 opened a new pull request, #27184: SSHOperator ignores cmd_timeout (#27182)

punx120 opened a new pull request, #27184:
URL: https://github.com/apache/airflow/pull/27184

   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   closes: #27182 
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


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


[GitHub] [airflow] punx120 commented on pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on PR #27184:
URL: https://github.com/apache/airflow/pull/27184#issuecomment-1303911825

   @eladkal @potiuk Can one of you please approve so we can merge it? 


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


[GitHub] [airflow] o-nikolas commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1007576007


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   I don't have a deep enough understanding of the select api and ssh to know for sure, but it seems harmless to check the others.
   
   If you're positive that this is correct then I'm happy to commit and approve.  



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


[GitHub] [airflow] eladkal commented on pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
eladkal commented on PR #27184:
URL: https://github.com/apache/airflow/pull/27184#issuecomment-1297009468

   I think we can just remove timeout parameter. 
   
   https://github.com/apache/airflow/blob/64174ce25ae800a38e712aa0bd62a5893ea2ff99/airflow/providers/ssh/operators/ssh.py#L102-L109
   
   The parameter is deprecated. Next release is a breaking change one so isn't it better to remove this parameter and adjust the fix accordingly? 


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


[GitHub] [airflow] punx120 commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1007434797


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   I'm not sure - from `select` doc
   ```
   the return value is a tuple of three lists corresponding to the first three arguments; 
   each contains the subset of the corresponding file descriptors that are ready.
   ```
   and we pass empty list to 2nd and 3rd args.



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


[GitHub] [airflow] punx120 commented on pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on PR #27184:
URL: https://github.com/apache/airflow/pull/27184#issuecomment-1297095327

   > I think we can just remove timeout parameter.
   > 
   > https://github.com/apache/airflow/blob/64174ce25ae800a38e712aa0bd62a5893ea2ff99/airflow/providers/ssh/operators/ssh.py#L102-L109
   > 
   > The parameter is deprecated. Next release is a breaking change one so isn't it better to remove this parameter and adjust the fix accordingly?
   
   Sure i can look into that


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


[GitHub] [airflow] punx120 commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1007976453


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   Since we're passing empty list for the 2nd and 3rd arg, i dont see how the other 2 cannot be empty. It makes sense to pass empty file descriptors since the 2nd arg is for writing and the 3rd for exception condition.



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


[GitHub] [airflow] punx120 commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1008505073


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   what's the next step to get this merged?



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


[GitHub] [airflow] o-nikolas commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1007236645


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   I think you need to check if **all** three results are empty to be sure a timeout has occurred. Useful link: https://stackoverflow.com/a/15195460/1055702



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


[GitHub] [airflow] o-nikolas commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1008653675


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   > what's the next step to get this merged?
   
   There are some static checks that are failing which need fixing before it can be merged. You can enable pre-commit to run static checks on your code before submitting a PR update ([readme](https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#installing-pre-commit-hooks)) 
   
   Then someone with committer status will need to review/approve/merge the change :) (CC: @eladkal @potiuk)
   



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


[GitHub] [airflow] punx120 commented on pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on PR #27184:
URL: https://github.com/apache/airflow/pull/27184#issuecomment-1297138388

   > > I think we can just remove timeout parameter.
   > > https://github.com/apache/airflow/blob/64174ce25ae800a38e712aa0bd62a5893ea2ff99/airflow/providers/ssh/operators/ssh.py#L102-L109
   > > 
   > > The parameter is deprecated. Next release is a breaking change one so isn't it better to remove this parameter and adjust the fix accordingly?
   > 
   > Sure i can look into that
   
   Done!


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


[GitHub] [airflow] boring-cyborg[bot] commented on pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #27184:
URL: https://github.com/apache/airflow/pull/27184#issuecomment-1304991140

   Awesome work, congrats on your first merged pull request!
   


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


[GitHub] [airflow] potiuk merged pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
potiuk merged PR #27184:
URL: https://github.com/apache/airflow/pull/27184


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


[GitHub] [airflow] punx120 commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1008709129


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   got it - i think i fixed it - re-running now



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


[GitHub] [airflow] o-nikolas commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1008308776


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   Okay, sounds good, approving :) 



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


[GitHub] [airflow] punx120 commented on a diff in pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
punx120 commented on code in PR #27184:
URL: https://github.com/apache/airflow/pull/27184#discussion_r1009330408


##########
airflow/providers/ssh/hooks/ssh.py:
##########
@@ -491,9 +491,12 @@ def exec_ssh_client_command(
         if stdout_buffer_length > 0:
             agg_stdout += stdout.channel.recv(stdout_buffer_length)
 
+        timedout = False
+
         # read from both stdout and stderr
         while not channel.closed or channel.recv_ready() or channel.recv_stderr_ready():
             readq, _, _ = select([channel], [], [], timeout)
+            timedout = len(readq) == 0

Review Comment:
   Thank you @potiuk anything else we need to merge it?



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


[GitHub] [airflow] boring-cyborg[bot] commented on pull request #27184: SSHOperator ignores cmd_timeout (#27182)

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #27184:
URL: https://github.com/apache/airflow/pull/27184#issuecomment-1286924883

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


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