HBASE-19866 TestRegionServerReportForDuty doesn't timeout
Synchronized on authManager instead of RpcServer
This commit is contained in:
parent
305da1098a
commit
5b93ea1556
|
@ -355,10 +355,12 @@ public abstract class RpcServer implements RpcServerInterface,
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized void refreshAuthManager(PolicyProvider pp) {
|
||||
public void refreshAuthManager(PolicyProvider pp) {
|
||||
// Ignore warnings that this should be accessed in a static way instead of via an instance;
|
||||
// it'll break if you go via static route.
|
||||
this.authManager.refresh(this.conf, pp);
|
||||
synchronized (authManager) {
|
||||
authManager.refresh(this.conf, pp);
|
||||
}
|
||||
}
|
||||
|
||||
protected AuthenticationTokenSecretManager createSecretManager() {
|
||||
|
@ -534,19 +536,18 @@ public abstract class RpcServer implements RpcServerInterface,
|
|||
|
||||
/**
|
||||
* Authorize the incoming client connection.
|
||||
*
|
||||
* @param user client user
|
||||
* @param connection incoming connection
|
||||
* @param addr InetAddress of incoming connection
|
||||
* @throws org.apache.hadoop.security.authorize.AuthorizationException
|
||||
* when the client isn't authorized to talk the protocol
|
||||
* @throws AuthorizationException when the client isn't authorized to talk the protocol
|
||||
*/
|
||||
public synchronized void authorize(UserGroupInformation user,
|
||||
ConnectionHeader connection, InetAddress addr)
|
||||
throws AuthorizationException {
|
||||
public void authorize(UserGroupInformation user, ConnectionHeader connection,
|
||||
InetAddress addr) throws AuthorizationException {
|
||||
if (authorize) {
|
||||
Class<?> c = getServiceInterface(services, connection.getServiceName());
|
||||
this.authManager.authorize(user != null ? user : null, c, getConf(), addr);
|
||||
synchronized (authManager) {
|
||||
authManager.authorize(user, c, getConf(), addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue