From e64ba87486b9cb40474dfe27cf735cf179cb174c Mon Sep 17 00:00:00 2001 From: James Clampffer Date: Mon, 10 Jul 2017 12:09:30 -0400 Subject: [PATCH] HDFS-12104: libhdfs++: Make sure all steps in SaslProtocol end up calling AuthComplete. Contributed by James Clampffer. --- .../src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc index 49abe5899a..3d40c0fd6a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc @@ -87,6 +87,7 @@ void SaslProtocol::Authenticate(std::function connection = connection_.lock(); if (!connection) { + AuthComplete(Status::AuthenticationFailed("Lost RPC Connection"), AuthInfo()); return; } @@ -335,6 +336,7 @@ bool SaslProtocol::SendSaslMessage(RpcSaslProto & message) std::shared_ptr connection = connection_.lock(); if (!connection) { LOG_DEBUG(kRPC, << "Tried sending a SASL Message but the RPC connection was gone"); + AuthComplete(Status::AuthenticationFailed("Lost RPC Connection"), AuthInfo()); return false; }