Joe McDonnell created IMPALA-12224:
--------------------------------------

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


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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to