This is an automated email from the ASF dual-hosted git repository. mmartell pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-native.git
The following commit(s) were added to refs/heads/develop by this push: new 04d18c3 GEODE-10085: Don't start JmxManager if already running (#936) 04d18c3 is described below commit 04d18c380dea2bde30d3876de68f958513902b82 Author: Michael Martell <mmart...@pivotal.io> AuthorDate: Wed Mar 2 07:48:48 2022 -0800 GEODE-10085: Don't start JmxManager if already running (#936) * Don't start JmxManager if already started * Fix broken StartLocators() and StartServers() --- clicache/integration-test2/Cluster.cs | 14 ++++++++++---- cppcache/integration/framework/Cluster.cpp | 10 +++++++--- cppcache/integration/framework/Cluster.h | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/clicache/integration-test2/Cluster.cs b/clicache/integration-test2/Cluster.cs index f4deaa2..7d2639c 100644 --- a/clicache/integration-test2/Cluster.cs +++ b/clicache/integration-test2/Cluster.cs @@ -71,9 +71,12 @@ namespace Apache.Geode.Client.IntegrationTests for (var i = 0; i < locatorCount_; i++) { var locator = new Locator(this, new List<Locator>(), - name_ + "/locator/" + i.ToString()); + name_ + "/locator/" + i.ToString(), i == 0); locators_.Add(locator); - success = (locator.Start() == 0); + if (locator.Start() != 0 ) { + success = false; + break; + } } return success; } @@ -90,6 +93,7 @@ namespace Apache.Geode.Client.IntegrationTests if (localResult != 0) { success = false; + break; } } return success; @@ -165,12 +169,14 @@ namespace Apache.Geode.Client.IntegrationTests private string name_; private List<Locator> locators_; private bool started_; + private bool startJmxManager_; - public Locator(Cluster cluster, List<Locator> locators, string name) + public Locator(Cluster cluster, List<Locator> locators, string name, bool startJmxManager) { cluster_ = cluster; locators_ = locators; name_ = name; + startJmxManager_ = startJmxManager; var address = new Address(); address.address = "localhost"; address.port = Framework.FreeTcpPort(); @@ -193,7 +199,7 @@ namespace Apache.Geode.Client.IntegrationTests .withPort(Address.port) .withMaxHeap("256m") .withJmxManagerPort(cluster_.jmxManagerPort) - .withJmxManagerStart(true) + .withJmxManagerStart(startJmxManager_) .withHttpServicePort(0); if (cluster_.UseSSL) { diff --git a/cppcache/integration/framework/Cluster.cpp b/cppcache/integration/framework/Cluster.cpp index ff92cd1..7a69b7b 100644 --- a/cppcache/integration/framework/Cluster.cpp +++ b/cppcache/integration/framework/Cluster.cpp @@ -73,7 +73,7 @@ Locator::Locator(Locator &&move) const LocatorAddress &Locator::getAddress() const { return locatorAddress_; } -void Locator::start() { +void Locator::start(bool startJmxManager) { if (started_) return; auto safeName = name_; @@ -109,7 +109,7 @@ void Locator::start() { .withClasspath(cluster_.getClasspath()) .withSecurityManager(cluster_.getSecurityManager()) .withPreferIPv6(cluster_.getUseIPv6()) - .withJmxManagerStart(true); + .withJmxManagerStart(startJmxManager); if (cluster_.useSsl()) { locator.withConnect(false) @@ -485,8 +485,12 @@ void Cluster::startServers() { void Cluster::startLocators() { std::vector<std::future<void>> futures; + bool startJmxManager = true; for (auto &locator : locators_) { - futures.push_back(std::async(std::launch::async, [&] { locator.start(); })); + futures.push_back(std::async(std::launch::async, [&, startJmxManager] { + locator.start(startJmxManager); + })); + startJmxManager = false; } // TODO hack until there is a way to either tell servers to retry or wait diff --git a/cppcache/integration/framework/Cluster.h b/cppcache/integration/framework/Cluster.h index 5085ff5..333297d 100644 --- a/cppcache/integration/framework/Cluster.h +++ b/cppcache/integration/framework/Cluster.h @@ -56,7 +56,7 @@ class Locator { const LocatorAddress &getAddress() const; - void start(); + void start(bool startJmxManager); void stop();