impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [5/6] incubator-impala git commit: IMPALA-5182: Explicitly close connection to impalad on error from shell
Date Fri, 21 Apr 2017 00:40:48 GMT
IMPALA-5182: Explicitly close connection to impalad on error from shell

When using connections secured with SSL, a connection close comprises
of a bi-directional SSL_shutdown(). The second part of the
bi-directional shutdown requires that the client also close the socket
explicitly, and the server blocks till it gets the close
notification from the client.

This patch ensures that the above happens. Without this fix, the
impala-shell was found to hang over connections secured with SSL
when an error was encountered.

Change-Id: I814df93bbcd457ad3f96b4c1ef5d8b0ddd6d141f
Reviewed-by: Sailesh Mukil <>
Tested-by: Impala Public Jenkins


Branch: refs/heads/master
Commit: 2a34076b2db99bb83eb3e3929d310fcb10b1dd44
Parents: e0d1db5
Author: Sailesh Mukil <>
Authored: Thu Apr 6 22:32:03 2017 -0700
Committer: Impala Public Jenkins <>
Committed: Thu Apr 20 23:14:33 2017 +0000

 shell/ | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/shell/ b/shell/
index 00aff33..630a4e1 100755
--- a/shell/
+++ b/shell/
@@ -705,6 +705,8 @@ class ImpalaShell(cmd.Cmd):
         self.prompt = self.DISCONNECTED_PROMPT
     except Exception, e:
       print_to_stderr("Error connecting: %s, %s" % (type(e).__name__, e))
+      # A secure connection may still be open. So we explicitly close it.
+      self.imp_client.close_connection()
       # If a connection to another impalad failed while already connected
       # reset the prompt to disconnected.
       self.server_version = self.UNKNOWN_SERVER_VERSION

View raw message