You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2016/09/28 23:28:37 UTC

[2/6] incubator-geode git commit: GEODE-1938: Remove the exception ignore when a pool cannot connect to a server

GEODE-1938: Remove the exception ignore when a pool cannot connect to a server


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

Branch: refs/heads/develop
Commit: e29b7752a2ab7e805c8c734198ce0203ead48622
Parents: cf0b378
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Tue Sep 27 06:30:40 2016 +1000
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Tue Sep 27 06:30:40 2016 +1000

----------------------------------------------------------------------
 .../pdx/internal/ClientTypeRegistration.java     | 19 ++++++-------------
 .../cache/snapshot/GFSnapshotDUnitTest.java      |  6 ++----
 2 files changed, 8 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e29b7752/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
index b7f27f3..261cc53 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/ClientTypeRegistration.java
@@ -74,15 +74,11 @@ public class ClientTypeRegistration implements TypeRegistration {
   }
 
   private void sendTypeToAllPools(PdxType type, int id, Pool pool) {
-
     try {
       AddPDXTypeOp.execute((ExecutablePool) pool, id, type);
-    } catch (ServerConnectivityException ignore) {
-      logger.debug("Received an exception sending pdx type to pool {}, {}", pool, ignore.getMessage(), ignore);
-      //TODO DAN - is it really safe to ignore this? What if this is the pool
-      //we're about to do a put on? I think maybe we really should pass the context
-      //down to this point, if it is available. Maybe just an optional thread local?
-      //Then we could go straight to that pool to register the type and bail otherwise.
+    } catch (ServerConnectivityException serverConnectivityException) {
+      logger.debug("Received an exception sending pdx type to pool {}, {}", pool, serverConnectivityException.getMessage(), serverConnectivityException);
+      throw serverConnectivityException;
     }
   }
 
@@ -177,12 +173,9 @@ public class ClientTypeRegistration implements TypeRegistration {
   private void sendEnumIdToAllPools(EnumInfo enumInfo, int id, Pool pool) {
     try {
       AddPDXEnumOp.execute((ExecutablePool) pool, id, enumInfo);
-    } catch (ServerConnectivityException ignore) {
-      logger.debug("Received an exception sending pdx type to pool {}, {}", pool, ignore.getMessage(), ignore);
-      //TODO DAN - is it really safe to ignore this? What if this is the pool
-      //we're about to do a put on? I think maybe we really should pass the context
-      //down to this point, if it is available. Maybe just an optional thread local?
-      //Then we could go straight to that pool to register the type and bail otherwise.
+    } catch (ServerConnectivityException serverConnectivityException) {
+      logger.debug("Received an exception sending pdx type to pool {}, {}", pool, serverConnectivityException.getMessage(), serverConnectivityException);
+      throw serverConnectivityException;
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e29b7752/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotDUnitTest.java
index 2ca3aec..b1b2eca 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/snapshot/GFSnapshotDUnitTest.java
@@ -61,8 +61,6 @@ public class GFSnapshotDUnitTest extends JUnit4DistributedTestCase {
   private VM server;
   private VM client;
   private Host host;
-  private LocatorLauncher locatorLauncher;
-  private static ServerLauncher serverLauncher;
 
   @Rule
   public SerializableTemporaryFolder temporaryFolder = new SerializableTemporaryFolder();
@@ -167,7 +165,7 @@ public class GFSnapshotDUnitTest extends JUnit4DistributedTestCase {
     for (String propertyName : properties.stringPropertyNames()) {
       builder.set(propertyName, properties.getProperty(propertyName));
     }
-    locatorLauncher = builder.setBindAddress(serverHostName)
+    LocatorLauncher locatorLauncher = builder.setBindAddress(serverHostName)
                              .setHostnameForClients(serverHostName)
                              .setMemberName(memberName)
                              .setPort(locatorPort)
@@ -190,7 +188,7 @@ public class GFSnapshotDUnitTest extends JUnit4DistributedTestCase {
       builder.set(propertyName, properties.getProperty(propertyName));
     }
 
-    serverLauncher = builder.set("locators", serverHostName + "[" + locatorPort + "]")
+    ServerLauncher serverLauncher = builder.set("locators", serverHostName + "[" + locatorPort + "]")
                             .setMemberName(memberName)
                             .set("log-level", "config")
                             .setHostNameForClients(serverHostName)