You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/06/21 05:22:00 UTC

[jira] [Commented] (IMPALA-12224) Interactive shell tests should detect connection failures rather than hanging

    [ https://issues.apache.org/jira/browse/IMPALA-12224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735535#comment-17735535 ] 

ASF subversion and git services commented on IMPALA-12224:
----------------------------------------------------------

Commit bad064dbeab8a8e7f73c1f0ac5abe0c33f1ca967 in impala's branch refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=bad064dbe ]

IMPALA-12224: Improve error handling for shell interactive tests

Interactive shell tests can hang waiting for input if the
shell process hits errors or exits. For example, the problems
in the sasl package seen in IMPALA-12220 cause test_shell_interactive.py
to hang.

This improves the error detection/handling to avoid hangs for
most common shell errors. Specifically, it adds a check for
the impala-shell process exiting, and it adds a check for
a failure to connect to Impala. Both would previous result
in hangs.

Testing:
 - Verified test_shell_interactive.py doesn't hang with hand
   tests
 - Remove a vital import from impala-shell so it exits instantly
 - Simulate a connection problem by overwriting the port
   with a non-functional port
 - Test on Redhat 9 with the IMPALA-12220 issue

Change-Id: I7556fb687e06b41caa538d8c3231ec9f2ad98162
Reviewed-on: http://gerrit.cloudera.org:8080/20087
Reviewed-by: Michael Smith <mi...@cloudera.com>
Tested-by: Joe McDonnell <jo...@cloudera.com>


> Interactive shell tests should detect connection failures rather than hanging
> -----------------------------------------------------------------------------
>
>                 Key: IMPALA-12224
>                 URL: https://issues.apache.org/jira/browse/IMPALA-12224
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Infrastructure
>    Affects Versions: Impala 4.3.0
>            Reporter: Joe McDonnell
>            Assignee: Joe McDonnell
>            Priority: Major
>
> In tests/shell/util.py, the ImpalaShell __init__ function runs impala-shell and tries to connect to Impala (or Hive). This tries to time out if connection fails:
> {noformat}
>     # When --quiet option is passed to Impala shell, we should not wait until we see
>     # "Connected to" because it will never be printed to stderr. The same is true
>     # if stderr is redirected.
>     if wait_until_connected and (args is None or "--quiet" not in args) and \
>        stderr_file is None:
>       start_time = time.time()
>       connected = False
>       while time.time() - start_time < timeout and not connected:
>         connected = "Connected to" in self.shell_process.stderr.readline()
>       assert connected, "Impala shell is not connected"{noformat}
> [https://github.com/apache/impala/blob/master/tests/shell/util.py#L227-L236]
> In practice, this code hangs when impala-shell fails to connect. The big problem is that it doesn't detect impala-shell's error message, so it keeps reading input. The timeout never fires, because the readline() method blocks forever. This means that basic problems in impala-shell result in tests hanging rather than failing. This comes up for https://issues.apache.org/jira/browse/IMPALA-12220.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org