You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2018/01/30 01:57:05 UTC
[38/50] [abbrv] hbase git commit: HBASE-19866
TestRegionServerReportForDuty doesn't timeout
HBASE-19866 TestRegionServerReportForDuty doesn't timeout
Synchronized on authManager instead of RpcServer
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5b93ea15
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5b93ea15
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5b93ea15
Branch: refs/heads/HBASE-19064
Commit: 5b93ea155652292ad06ee3df85e5944191eace9b
Parents: 305da10
Author: zhangduo <zh...@apache.org>
Authored: Sat Jan 27 09:01:52 2018 +0800
Committer: zhangduo <zh...@apache.org>
Committed: Mon Jan 29 21:23:47 2018 +0800
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/ipc/RpcServer.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/5b93ea15/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
index 1faee90..d60612f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
@@ -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);
+ }
}
}