HBASE-24747 Log an ERROR if HBaseSaslRpcServer initialisation fails with an uncaught exception (#2079)

Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Josh Elser <elserj@apache.org>
(cherry picked from commit bd42c75cac)
This commit is contained in:
Wellington Ramos Chevreuil 2020-07-17 18:50:03 +01:00 committed by Wellington Chevreuil
parent 0a8a7fa2ed
commit 8c89582633
1 changed files with 7 additions and 1 deletions

View File

@ -348,8 +348,14 @@ abstract class ServerRpcConnection implements Closeable {
byte[] replyToken; byte[] replyToken;
try { try {
if (saslServer == null) { if (saslServer == null) {
saslServer = try {
saslServer =
new HBaseSaslRpcServer(provider, rpcServer.saslProps, rpcServer.secretManager); new HBaseSaslRpcServer(provider, rpcServer.saslProps, rpcServer.secretManager);
} catch (Exception e){
RpcServer.LOG.error("Error when trying to create instance of HBaseSaslRpcServer "
+ "with sasl provider: " + provider, e);
throw e;
}
RpcServer.LOG.debug("Created SASL server with mechanism={}", RpcServer.LOG.debug("Created SASL server with mechanism={}",
provider.getSaslAuthMethod().getAuthMethod()); provider.getSaslAuthMethod().getAuthMethod());
} }