You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by zh...@apache.org on 2019/10/11 17:19:57 UTC

[geode] 01/01: GEODE-7277: need to wrap the local destroy region in try-catch

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

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

commit 24360c69284cdac44fa85f654b6abd7010cbee6a
Author: zhouxh <gz...@pivotal.io>
AuthorDate: Fri Oct 11 10:18:26 2019 -0700

    GEODE-7277: need to wrap the local destroy region in try-catch
---
 .../apache/geode/management/internal/FederatingManager.java | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
index ca735c0..51a569e 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
@@ -40,6 +40,7 @@ import org.apache.geode.cache.EvictionAction;
 import org.apache.geode.cache.EvictionAttributes;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
+import org.apache.geode.cache.RegionDestroyedException;
 import org.apache.geode.cache.RegionExistsException;
 import org.apache.geode.cache.Scope;
 import org.apache.geode.cache.TimeoutException;
@@ -213,8 +214,16 @@ public class FederatingManager extends Manager {
     // If cache is closed all the regions would have been destroyed implicitly
     if (!cache.isClosed()) {
       proxyFactory.removeAllProxies(member, proxyRegion);
-      proxyRegion.localDestroyRegion();
-      notificationRegion.localDestroyRegion();
+      try {
+        proxyRegion.localDestroyRegion();
+      } catch (RegionDestroyedException rde) {
+        logger.info("Region has been destroyed during closing cache. " + rde.getMessage());
+      }
+      try {
+        notificationRegion.localDestroyRegion();
+      } catch (RegionDestroyedException rde) {
+        logger.info("Region has been destroyed during closing cache. " + rde.getMessage());
+      }
     }
 
     if (!system.getDistributedMember().equals(member)) {