[
https://issues.apache.org/jira/browse/GEODE-3973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16251637#comment-16251637
]
ASF GitHub Bot commented on GEODE-3973:
---------------------------------------
jinmeiliao closed pull request #1050: GEODE-3973: have the cluster
configuration start synchronously when s…
URL: https://github.com/apache/geode/pull/1050
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
index 942bbf24d8..73b971e330 100644
---
a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
+++
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
@@ -602,31 +602,6 @@ public static InternalLocator startLocator(int
locatorPort, File logFile, File s
s);
}
- class SharedConfigurationRunnable implements Runnable {
-
- private final InternalLocator locator = InternalLocator.this;
-
- @Override
- public void run() {
- try {
- if (this.locator.sharedConfig == null) {
- // locator.sharedConfig will already be created in case of
auto-reconnect
- this.locator.sharedConfig = new
ClusterConfigurationService(locator.myCache);
- }
-
this.locator.sharedConfig.initSharedConfiguration(this.locator.loadFromSharedConfigDir());
- this.locator.installSharedConfigDistribution();
- logger.info(
- "Cluster configuration service start up completed successfully and
is now running ....");
- } catch (CancelException | LockServiceDestroyedException e) {
- if (logger.isDebugEnabled()) {
- logger.debug("Cluster configuration start up was cancelled", e);
- }
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- }
- }
- }
-
/**
* Start a distributed system whose life cycle is managed by this locator.
When the locator is
* stopped, this distributed system will be disconnected. If a distributed
system already exists,
@@ -722,7 +697,7 @@ private void startCache(DistributedSystem ds) {
}
startJmxManagerLocationService(internalCache);
- startSharedConfigurationService(internalCache);
+ startSharedConfigurationService();
}
/**
@@ -1089,19 +1064,13 @@ private void restartWithDS(InternalDistributedSystem
newSystem, InternalCache ne
this.myCache = newCache;
this.myDs.setDependentLocator(this);
logger.info("Locator restart: initializing TcpServer");
- if (isSharedConfigurationEnabled()) {
- this.sharedConfig = new ClusterConfigurationService(newCache);
- }
+
this.server.restarting(newSystem, newCache, this.sharedConfig);
if (this.productUseLog.isClosed()) {
this.productUseLog.reopen();
}
this.productUseLog.monitorUse(newSystem);
- this.isSharedConfigurationStarted = true;
- if (isSharedConfigurationEnabled()) {
- ExecutorService es = newCache.getDistributionManager().getThreadPool();
- es.execute(new SharedConfigurationRunnable());
- }
+ startSharedConfigurationService();
if (!this.server.isAlive()) {
logger.info("Locator restart: starting TcpServer");
startTcpServer();
@@ -1378,20 +1347,41 @@ public void endJob() {
}
}
- private void startSharedConfigurationService(InternalCache internalCache) {
+ private void startSharedConfigurationService() {
installSharedConfigHandler();
- if (this.config.getEnableClusterConfiguration() &&
!this.isSharedConfigurationStarted) {
- if (!isDedicatedLocator()) {
- logger.info("Cluster configuration service not enabled as it is only
supported "
- + "in dedicated locators");
- return;
- }
-
- ExecutorService es =
internalCache.getDistributionManager().getThreadPool();
- es.execute(new SharedConfigurationRunnable());
- } else {
+ if (!config.getEnableClusterConfiguration()) {
logger.info("Cluster configuration service is disabled");
+ return;
+ }
+
+ if (isSharedConfigurationStarted) {
+ logger.info("Cluster configuration service is already started.");
+ return;
+ }
+
+ if (!isDedicatedLocator()) {
+ logger.info("Cluster configuration service not enabled as it is only
supported "
+ + "in dedicated locators");
+ return;
+ }
+
+ try {
+ if (this.locator.sharedConfig == null) {
+ // locator.sharedConfig will already be created in case of
auto-reconnect
+ this.locator.sharedConfig = new
ClusterConfigurationService(locator.myCache);
+ }
+
this.locator.sharedConfig.initSharedConfiguration(this.locator.loadFromSharedConfigDir());
+ this.locator.installSharedConfigDistribution();
+ logger.info(
+ "Cluster configuration service start up completed successfully and
is now running ....");
+ isSharedConfigurationStarted = true;
+ } catch (CancelException | LockServiceDestroyedException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Cluster configuration start up was cancelled", e);
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Do not start cluster configuration service asynchronously
> ---------------------------------------------------------
>
> Key: GEODE-3973
> URL: https://issues.apache.org/jira/browse/GEODE-3973
> Project: Geode
> Issue Type: Bug
> Components: management
> Reporter: Jinmei Liao
>
> starting CC asynchronously creates a gap between a locator startup and
> cluster configuration service being started and ready, which leads to some
> servers starting up not getting any cluster configuration.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)