Skip to content

Commit 245c7bb

Browse files
committed
HBASE-25875 RegionServer failed to start due to IllegalThreadStateException in AuthenticationTokenSecretManager.start
1 parent 2b6a91a commit 245c7bb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,12 @@ public synchronized void start() {
130130
}
131131
authTokenSecretMgr = createSecretManager();
132132
if (authTokenSecretMgr != null) {
133-
setSecretManager(authTokenSecretMgr);
134-
authTokenSecretMgr.start();
133+
// Start AuthenticationTokenSecretManager in synchronized way to avoid race conditions in
134+
// LeaderElector start. See HBASE-25875
135+
synchronized (authTokenSecretMgr) {
136+
setSecretManager(authTokenSecretMgr);
137+
authTokenSecretMgr.start();
138+
}
135139
}
136140
this.authManager = new ServiceAuthorizationManager();
137141
HBasePolicyProvider.init(conf, authManager);

0 commit comments

Comments
 (0)