From 7d0203bf56d850702e471ee62818909af644cf52 Mon Sep 17 00:00:00 2001 From: Pankaj Kumar Date: Tue, 11 May 2021 01:28:09 +0530 Subject: [PATCH 1/3] HBASE-25875 RegionServer failed to start due to IllegalThreadStateException in AuthenticationTokenSecretManager.start --- .../java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java index 1d3981f78846..b7d446bc0feb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java @@ -130,8 +130,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); From 430767d53df5c34b718f78b65a17ccd51a3ae884 Mon Sep 17 00:00:00 2001 From: Pankaj Kumar Date: Tue, 11 May 2021 23:13:32 +0530 Subject: [PATCH 2/3] HBASE-25875 RegionServer failed to start due to IllegalThreadStateException in AuthenticationTokenSecretManager.start --- .../java/org/apache/hadoop/hbase/ipc/SimpleRpcServer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcServer.java index 38c771277360..bab0a6dec091 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcServer.java @@ -417,8 +417,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); From 47d8cd17a7bbc143c6fe560ab6362fad9c16d090 Mon Sep 17 00:00:00 2001 From: Pankaj Kumar Date: Thu, 13 May 2021 11:13:42 +0530 Subject: [PATCH 3/3] HBASE-25875 Excluded spotbugs ML_SYNC_ON_UPDATED_FIELD warn --- dev-support/spotbugs-exclude.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dev-support/spotbugs-exclude.xml b/dev-support/spotbugs-exclude.xml index 1137f5fdc142..2f0684eff4d7 100644 --- a/dev-support/spotbugs-exclude.xml +++ b/dev-support/spotbugs-exclude.xml @@ -252,4 +252,23 @@ + + + + + + + + + + + + + + +