GEODE-216: Handle any exception that might be thrown

The old code was trying to prevent a deadlock under some certain
conditions. But if it can not get a PR because of an exception
then a deadlock is not possible. So the new code just catches
and ignores exceptions and falls through to the code that will
process the message the old way. This code will encounter the
same exception and has the proper logic to handle it.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/41d04928
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/41d04928
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/41d04928

Branch: refs/heads/feature/GEODE-12
Commit: 41d04928be3a455b02e58432713ed694f5f2b238
Parents: 587f589
Author: Darrel Schneider <[email protected]>
Authored: Thu Aug 13 16:16:43 2015 -0700
Committer: Darrel Schneider <[email protected]>
Committed: Thu Aug 13 16:16:43 2015 -0700

----------------------------------------------------------------------
 .../gemfire/internal/cache/partitioned/GetMessage.java         | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/41d04928/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java
----------------------------------------------------------------------
diff --git 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java
 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java
index c8d990d..64cbccd 100644
--- 
a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java
+++ 
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java
@@ -129,6 +129,12 @@ public final class GetMessage extends 
PartitionMessageWithDirectReply
           return DistributionManager.PARTITIONED_REGION_EXECUTOR;
         }
       } catch (PRLocallyDestroyedException ignore) {
+      } catch (RuntimeException ignore) {
+        // fix for GEODE-216
+        // Most likely here would be RegionDestroyedException or 
CacheClosedException
+        // but the cancel criteria code can throw any RuntimeException.
+        // In all these cases it is ok to just fall through and return the
+        // old executor type.
       }
     }
     if (forceUseOfPRExecutor) {

Reply via email to