This is an automated email from the ASF dual-hosted git repository.

eshu11 pushed a commit to branch feature/GEODE-7576
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-7576 by this 
push:
     new 74ac2a2  GEODE-7576: execute bootstrapping function after cache fully 
created
74ac2a2 is described below

commit 74ac2a2269420f147006f5c7a22750672df0c23f
Author: Eric Shu <[email protected]>
AuthorDate: Fri Dec 13 12:47:57 2019 -0800

    GEODE-7576: execute bootstrapping function after cache fully created
---
 .../java/org/apache/geode/modules/util/BootstrappingFunction.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
index 2e606a0..ff50c29 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java
@@ -57,7 +57,8 @@ public class BootstrappingFunction implements Function, 
MembershipListener, Data
     // Verify that the cache exists before continuing.
     // When this function is executed by a remote membership listener, it is
     // being invoked before the cache is started.
-    Cache cache = verifyCacheExists();
+    Cache cache = verifyCacheExists(
+        context.getCache() == null ? null : 
context.getCache().getDistributedSystem());
 
     // Register as membership listener
     registerAsMembershipListener(cache);
@@ -77,12 +78,12 @@ public class BootstrappingFunction implements Function, 
MembershipListener, Data
     return member.getVmKind() == ClusterDistributionManager.LOCATOR_DM_TYPE;
   }
 
-  protected Cache verifyCacheExists() {
+  protected Cache verifyCacheExists(DistributedSystem system) {
     int timeToWait = 0;
     Cache cache = null;
     while (timeToWait < TIME_TO_WAIT_FOR_CACHE) {
       try {
-        cache = CacheFactory.getAnyInstance();
+        cache = system == null ? CacheFactory.getAnyInstance() : 
CacheFactory.getInstance(system);
         break;
       } catch (Exception ignore) {
         // keep trying and hope for the best

Reply via email to