HBASE-13969 AuthenticationTokenSecretManager is never stopped in RPCServer (Pankaj Kumar)

This commit is contained in:
tedyu 2015-06-25 17:42:22 -07:00
parent 70f0ca3c6d
commit 2ed058554c
1 changed files with 9 additions and 4 deletions

View File

@ -251,6 +251,7 @@ public class RpcServer implements RpcServerInterface {
//of client connections
private Listener listener = null;
protected Responder responder = null;
protected AuthenticationTokenSecretManager authTokenSecretMgr = null;
protected int numConnections = 0;
protected HBaseRPCErrorHandler errorHandler = null;
@ -2070,10 +2071,10 @@ public class RpcServer implements RpcServerInterface {
@Override
public synchronized void start() {
if (started) return;
AuthenticationTokenSecretManager mgr = createSecretManager();
if (mgr != null) {
setSecretManager(mgr);
mgr.start();
authTokenSecretMgr = createSecretManager();
if (authTokenSecretMgr != null) {
setSecretManager(authTokenSecretMgr);
authTokenSecretMgr.start();
}
this.authManager = new ServiceAuthorizationManager();
HBasePolicyProvider.init(conf, authManager);
@ -2234,6 +2235,10 @@ public class RpcServer implements RpcServerInterface {
public synchronized void stop() {
LOG.info("Stopping server on " + port);
running = false;
if (authTokenSecretMgr != null) {
authTokenSecretMgr.stop();
authTokenSecretMgr = null;
}
listener.interrupt();
listener.doStop();
responder.interrupt();