Sailesh Mukil has uploaded a new patch set (#7). Change subject: IMPALA-2864: Ensure that client connections are closed after a failed RPC and a failed Open() ......................................................................
IMPALA-2864: Ensure that client connections are closed after a failed RPC and a failed Open() In DoRpc(), when an RPC fails, we call Reopen() and try again. If it fails for the second time, we just return with an error. However, that socket may still be open on the server side which could keep waiting for the client because the client never closed the socket and may never use it again before it returns the connection to the client-cache, because it returned with an error. Similarly, 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 hang by waiting on the same connection. This patch closes the client side socket, thereby terminating the connection to the server in both the above scenarios, so that Impala can fail gracefully without hanging. A thrift-server-test is added to test the RPC failure path. Change-Id: Ia7e883d8224304ad13a051f595d0e8abf4f9671e --- 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.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 8 files changed, 120 insertions(+), 6 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/99/1599/7 -- To view, visit http://gerrit.cloudera.org:8080/1599 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia7e883d8224304ad13a051f595d0e8abf4f9671e Gerrit-PatchSet: 7 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Sailesh Mukil <[email protected]> Gerrit-Reviewer: Casey Ching <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Henry Robinson <[email protected]> Gerrit-Reviewer: Matthew Jacobs <[email protected]> Gerrit-Reviewer: Sailesh Mukil <[email protected]>
