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 "Joe McDonnell (Jira)" <ji...@apache.org> on 2023/06/21 20:43:00 UTC

[jira] [Resolved] (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:all-tabpanel ]

Joe McDonnell resolved IMPALA-12224.
------------------------------------
    Fix Version/s: Impala 4.3.0
       Resolution: Fixed

> 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
>             Fix For: Impala 4.3.0
>
>
> 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