HBASE-11709 TestMasterShutdown can fail sometime
This commit is contained in:
parent
fadb0900a0
commit
9abe2da9e8
|
@ -644,11 +644,6 @@ public class AssignmentManager {
|
||||||
if (isDisabledorDisablingRegionInRIT(region)) {
|
if (isDisabledorDisablingRegionInRIT(region)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.serverManager.isClusterShutdown()) {
|
|
||||||
LOG.info("Cluster shutdown is set; skipping assign of " +
|
|
||||||
region.getRegionNameAsString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String encodedName = region.getEncodedName();
|
String encodedName = region.getEncodedName();
|
||||||
Lock lock = locker.acquireLock(encodedName);
|
Lock lock = locker.acquireLock(encodedName);
|
||||||
try {
|
try {
|
||||||
|
@ -2089,13 +2084,7 @@ public class AssignmentManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
shutdown(); // Stop executor service, etc
|
// Shutdown the threadpool executor service
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shutdown the threadpool executor service
|
|
||||||
*/
|
|
||||||
public void shutdown() {
|
|
||||||
threadPoolExecutorService.shutdownNow();
|
threadPoolExecutorService.shutdownNow();
|
||||||
regionStateStore.stop();
|
regionStateStore.stop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1632,18 +1632,16 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
|
||||||
LOG.error("Error call master coprocessor preShutdown()", ioe);
|
LOG.error("Error call master coprocessor preShutdown()", ioe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.assignmentManager != null) {
|
|
||||||
this.assignmentManager.shutdown();
|
if (this.serverManager != null) {
|
||||||
|
this.serverManager.shutdownCluster();
|
||||||
}
|
}
|
||||||
try {
|
if (this.clusterStatusTracker != null){
|
||||||
if (this.clusterStatusTracker != null){
|
try {
|
||||||
this.clusterStatusTracker.setClusterDown();
|
this.clusterStatusTracker.setClusterDown();
|
||||||
if (this.serverManager != null) {
|
} catch (KeeperException e) {
|
||||||
this.serverManager.shutdownCluster();
|
LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (KeeperException e) {
|
|
||||||
LOG.error("ZooKeeper exception trying to set cluster as down in ZK", e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -874,7 +874,7 @@ public class MasterRpcServices extends RSRpcServices
|
||||||
public IsMasterRunningResponse isMasterRunning(RpcController c,
|
public IsMasterRunningResponse isMasterRunning(RpcController c,
|
||||||
IsMasterRunningRequest req) throws ServiceException {
|
IsMasterRunningRequest req) throws ServiceException {
|
||||||
try {
|
try {
|
||||||
master.checkInitialized();
|
master.checkServiceStarted();
|
||||||
return IsMasterRunningResponse.newBuilder().setIsMasterRunning(
|
return IsMasterRunningResponse.newBuilder().setIsMasterRunning(
|
||||||
!master.isStopped()).build();
|
!master.isStopped()).build();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -670,7 +670,7 @@ public class HRegionServer extends HasThread implements
|
||||||
* @return False if cluster shutdown in progress
|
* @return False if cluster shutdown in progress
|
||||||
*/
|
*/
|
||||||
private boolean isClusterUp() {
|
private boolean isClusterUp() {
|
||||||
return this.clusterStatusTracker.isClusterUp();
|
return clusterStatusTracker != null && clusterStatusTracker.isClusterUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeThreads() throws IOException {
|
private void initializeThreads() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue