Internal Jenkins has submitted this change and it was merged. Change subject: IMPALA-2864: Ensure that client connections are closed after a failed Open() ......................................................................
IMPALA-2864: Ensure that client connections are closed after a failed Open() When a client tries to Open() a socket and fails, we previously assumed that the socket was never opened and therefore did not close it. However, if Kerberos is enabled, the ThriftClientImpl::Open() calls TSaslTransport::Open(), which not only opens the socket but also does the initial handshake. If there was an error during the handshake, we just returned with an error without closing the socket, causing the server side to wait on the same connection. This patch closes the client side socket, thereby terminating the connection to the server in the above scenario, so that the server side doesn't need to hold on to a connection until a timeout terminates the connection. A thrift-server-test is added to test the RPC failure path. Change-Id: Ia7e883d8224304ad13a051f595d0e8abf4f9671e Reviewed-on: http://gerrit.cloudera.org:8080/5385 Reviewed-by: Sailesh Mukil <sail...@cloudera.com> Tested-by: Internal Jenkins --- M be/src/rpc/thrift-client.cc M be/src/rpc/thrift-client.h M be/src/rpc/thrift-server-test.cc M be/src/runtime/client-cache.h M be/src/runtime/data-stream-test.cc A be/src/testutil/bad-cert.pem A be/src/testutil/bad-key.pem 7 files changed, 84 insertions(+), 2 deletions(-) Approvals: Internal Jenkins: Verified Sailesh Mukil: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/5385 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia7e883d8224304ad13a051f595d0e8abf4f9671e Gerrit-PatchSet: 4 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Sailesh Mukil <sail...@cloudera.com> Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com> Gerrit-Reviewer: Internal Jenkins Gerrit-Reviewer: Sailesh Mukil <sail...@cloudera.com>