geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: GEODE-77: fixing a ClassCastException observed in integration testing.
Date Wed, 21 Oct 2015 21:06:17 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-77 0c1008e65 -> 9d110301f


GEODE-77: fixing a ClassCastException observed in integration testing.

Sometimes the 'object' returned by the GC function is a String description
of an exception encountered while executing the function in another
member.  In that case we want to return the exception description to
gfsh as the result.


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

Branch: refs/heads/feature/GEODE-77
Commit: 9d110301f31d6176b276b69603fc998cd7db588c
Parents: 0c1008e
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Wed Oct 21 14:06:00 2015 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Wed Oct 21 14:06:00 2015 -0700

----------------------------------------------------------------------
 .../cli/commands/MiscellaneousCommands.java     | 22 +++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9d110301/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommands.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommands.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommands.java
index 852a507..4ebd947 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommands.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommands.java
@@ -380,18 +380,24 @@ public class MiscellaneousCommands implements CommandMarker {
         }
 
         if(object != null){
-          Map<String, String> resultMap = (Map<String, String>) object;
-          toTabularResultData(resultTable, (String) resultMap.get("MemberId"),
-              (String) resultMap.get("HeapSizeBeforeGC"),
-              (String) resultMap.get("HeapSizeAfterGC"),
-              (String) resultMap.get("TimeSpentInGC"));
-        }else{
+          if (object instanceof String) {
+            // unexpected exception string - cache may be closed or something
+            return ResultBuilder.createUserErrorResult((String)object);
+          } else {
+            Map<String, String> resultMap = (Map<String, String>) object;
+            toTabularResultData(resultTable, (String) resultMap.get("MemberId"),
+                (String) resultMap.get("HeapSizeBeforeGC"),
+                (String) resultMap.get("HeapSizeAfterGC"),
+                (String) resultMap.get("TimeSpentInGC"));
+          }
+        } else {
           LogWrapper.getInstance().fine("ResultMap was null ");
         }
       }
     } catch (Exception e) {
-      LogWrapper.getInstance().info("GC exception is " + CliUtil.stackTraceAsString((Throwable)e));
-      return ResultBuilder.createGemFireErrorResult(e.getMessage());
+      String stack = CliUtil.stackTraceAsString(e);
+      LogWrapper.getInstance().info("GC exception is " + stack);
+      return ResultBuilder.createGemFireErrorResult(e.getMessage() + ": " + stack);
     }
     return ResultBuilder.buildResult(resultTable);
   }


Mime
View raw message