You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/06/30 22:24:25 UTC

[GitHub] [geode] jinmeiliao commented on a change in pull request #6665: GEODE-9407: Handle exception getting region names

jinmeiliao commented on a change in pull request #6665:
URL: https://github.com/apache/geode/pull/6665#discussion_r661849690



##########
File path: geode-core/src/main/java/org/apache/geode/management/internal/util/ManagementUtils.java
##########
@@ -162,14 +163,20 @@ public static DistributedMember getDistributedMemberByNameOrId(String memberName
     Set<Region<?, ?>> rootRegions = cache.rootRegions();
 
     for (Region<?, ?> rootRegion : rootRegions) {
-      regionNames.add(rootRegion.getFullPath().substring(1));
+      try {
+        Set<Region<?, ?>> subRegions = rootRegion.subregions(true);
 
-      Set<Region<?, ?>> subRegions = rootRegion.subregions(true);
+        for (Region<?, ?> subRegion : subRegions) {
+          regionNames.add(subRegion.getFullPath().substring(1));
+        }
 
-      for (Region<?, ?> subRegion : subRegions) {
-        regionNames.add(subRegion.getFullPath().substring(1));
+      } catch (RegionDestroyedException ignored) {

Review comment:
       Are we sure this is the only exception this block of code can throw? If we want to prevent this block of code errors out, we should catch a general `Exception`, logs the exception, and then continue.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org