Quanlong Huang has uploaded this change for review. ( http://gerrit.cloudera.org:8080/19777
Change subject: IMPALA-12079: Print more details for uncaught exceptions in impala-shell ...................................................................... IMPALA-12079: Print more details for uncaught exceptions in impala-shell In _do_beeswax_rpc(), the exception handling code tries to recognize the exception and raise more meaningful exceptions. However, in the last case for unknown exceptions, it does nothing so the method just returns None. This makes the caller come into the error complaining 'NoneType' object is not iterable, since the caller expects the result is a tuple of two items: handle, rpc_status = self._do_beeswax_rpc(...) This patch prints more details of the unknown exception and finally raise an exception in _do_beeswax_rpc(). So the callers can show more meaningful errors. Tests: I can't reproduce the error mentioned in the JIRA description. So I manually modify the code to give _do_beeswax_rpc() a function that will always throw an exception. Here is the console output: $ impala-shell.sh --protocol=beeswax [localhost:21000] default> select 1; Query: select 1 Query submitted at: 2023-04-21 10:24:57 (Coordinator: http://quanlong-OptiPlex-BJ:25000) Caught exception My error, type=<type 'exceptions.Exception'> Traceback (most recent call last): File "/home/quanlong/workspace/Impala/shell/impala_client.py", line 1531, in _do_beeswax_rpc ret = rpc() File "/home/quanlong/workspace/Impala/shell/impala_client.py", line 1412, in myFunc raise Exception("My error") Exception: My error Unknown Exception : Encountered unknown exception Traceback (most recent call last): File "/home/quanlong/workspace/Impala/shell/impala_shell.py", line 1325, in _execute_stmt query_str, self.set_query_options) File "/home/quanlong/workspace/Impala/shell/impala_client.py", line 1414, in execute_query handle, rpc_status = self._do_beeswax_rpc(myFunc) File "/home/quanlong/workspace/Impala/shell/impala_client.py", line 1604, in _do_beeswax_rpc raise Exception("Encountered unknown exception") Exception: Encountered unknown exception [Not connected] > Goodbye quanlong Change-Id: I7d847251d3dab815af2427bf7701d60dc05af659 --- M shell/impala_client.py 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/77/19777/1 -- To view, visit http://gerrit.cloudera.org:8080/19777 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7d847251d3dab815af2427bf7701d60dc05af659 Gerrit-Change-Number: 19777 Gerrit-PatchSet: 1 Gerrit-Owner: Quanlong Huang <[email protected]>
