Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-25875 RegionServer failed to start with IllegalThreadStateException due to race condition in AuthenticationTokenSecretManager #3272

Merged
merged 1 commit into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions dev-support/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,23 @@
<Bug pattern="SC_START_IN_CTOR"/>
</Match>

<Match>
<!--
False positives, NettyRpcServer#start & SimpleRpcServer#start are already synchronized and
there is check to ensure single initialization of authTokenSecretMgr field.
Ignore the warning, see HBASE-25875.
!-->
<Or>
<And>
<Class name="org.apache.hadoop.hbase.ipc.NettyRpcServer"/>
<Method name="start"/>
</And>
<And>
<Class name="org.apache.hadoop.hbase.ipc.SimpleRpcServer"/>
<Method name="start"/>
</And>
</Or>
<Bug pattern="ML_SYNC_ON_UPDATED_FIELD"/>
</Match>

</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ public synchronized void start() {
}
authTokenSecretMgr = createSecretManager();
if (authTokenSecretMgr != null) {
setSecretManager(authTokenSecretMgr);
authTokenSecretMgr.start();
// Start AuthenticationTokenSecretManager in synchronized way to avoid race conditions in
// LeaderElector start. See HBASE-25875
synchronized (authTokenSecretMgr) {
setSecretManager(authTokenSecretMgr);
authTokenSecretMgr.start();
}
}
this.authManager = new ServiceAuthorizationManager();
HBasePolicyProvider.init(conf, authManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,12 @@ public synchronized void start() {
}
authTokenSecretMgr = createSecretManager();
if (authTokenSecretMgr != null) {
setSecretManager(authTokenSecretMgr);
authTokenSecretMgr.start();
// Start AuthenticationTokenSecretManager in synchronized way to avoid race conditions in
// LeaderElector start. See HBASE-25875
synchronized (authTokenSecretMgr) {
setSecretManager(authTokenSecretMgr);
authTokenSecretMgr.start();
}
}
this.authManager = new ServiceAuthorizationManager();
HBasePolicyProvider.init(conf, authManager);
Expand Down