You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ar...@apache.org on 2021/03/16 02:14:16 UTC

[impala] 02/02: IMPALA-10367: Impala-shell internal error - UnboundLocalError, local variable 'retry_msg' referenced before assign

This is an automated email from the ASF dual-hosted git repository.

arawat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 573c60a29849643b03fcd3a24ff88bdccc13fdac
Author: Abhishek Rawat <ar...@cloudera.com>
AuthorDate: Wed Mar 10 22:34:13 2021 -0800

    IMPALA-10367: Impala-shell internal error -
    UnboundLocalError, local variable 'retry_msg' referenced before assign
    
    ImpalaHS2Client._open_session() has a 'retry_msg' variable which was
    not initialized in the code-path where retry was disabled. If an
    exception was hit with retry disabled, a compile time error was
    generated.
    
    The fix is to initialize 'retry_msg' in the non retry code-path.
    
    Testing:
    - Forced exception in ImpalaHS2Client._open_session() and verified that
    proper error message was generated.
    - Ran impala-shell e2e and custom cluster tests.
    
    Change-Id: I50a08a62a332de759022d0a4862e74f5a81945d9
    Reviewed-on: http://gerrit.cloudera.org:8080/17172
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 shell/impala_client.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/shell/impala_client.py b/shell/impala_client.py
index cb4f811..6165503 100755
--- a/shell/impala_client.py
+++ b/shell/impala_client.py
@@ -662,6 +662,8 @@ class ImpalaHS2Client(ImpalaClient):
       set_all_handle = None
       if self.max_tries > 1:
         retry_msg = 'Num remaining tries: {0}'.format(self.max_tries - num_tries)
+      else:
+        retry_msg = ''
       try:
         set_all_handle = self.execute_query("set all", {})
         self.default_query_options = {}