Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-6716

ImpalaShell should not rely on global access to parsed command line options

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 3.0, Impala 2.12.0
    • Fix Version/s: Impala 3.0
    • Component/s: Clients
    • Labels:
      None
    • Epic Color:
      ghx-label-8

      Description

      A recent patch to address a problem line breaks in LDAP passwords (IMPALA-6610) can, in rare instances (e.g., when running the shell as an installed python package), result in an exception being thrown if the call to _connect() fails.

      $ impala-shell -i foo
      Starting Impala Shell without Kerberos authentication
      Traceback (most recent call last):
       File "/home/systest/shellenv/bin/impala-shell", line 11, in <module>
       load_entry_point('impala-shell', 'console_scripts', 'impala-shell')()
       File "/home/systest/Impala/shell/packaging/staging/impala_shell/impala_shell.py", line 1588, in main
       shell = ImpalaShell(options, query_options)
       File "/home/systest/Impala/shell/packaging/staging/impala_shell/impala_shell.py", line 209, in __init__
       self.do_connect(options.impalad)
       File "/home/systest/Impala/shell/packaging/staging/impala_shell/impala_shell.py", line 755, in do_connect
       self._connect()
       File "/home/systest/Impala/shell/packaging/staging/impala_shell/impala_shell.py", line 821, in _connect
       if options.ldap_password_cmd and \
      NameError: global name 'options' is not defined
      

      The error is actually in the connection failure handling code:
      https://github.com/apache/impala/blob/master/shell/impala_shell.py#L821

      The problem is that the shell instance should not assume continued access to the options returned from parser.parse_args(). In most cases, we store those values directly as member variables of the shell. We should do the same with all LDAP-related values, and then access those member variables.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dknupp David Knupp
                Reporter:
                dknupp David Knupp
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: