You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by vf...@apache.org on 2015/11/25 20:07:28 UTC

[15/50] [abbrv] incubator-geode git commit: GEODE-352: Fixing NPEs seen in the logs for PRClientServer tests

GEODE-352: Fixing NPEs seen in the logs for PRClientServer tests

Some code that was added to the client server handshake was looking up
connected distributed system when one might be in the process of being
closed.


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

Branch: refs/heads/feature/GEODE-78
Commit: 9ecb91a0e65f9bb6295bde30832b88b35a4badf9
Parents: 9a027ef
Author: Dan Smith <up...@apache.org>
Authored: Thu Sep 24 16:05:18 2015 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Sep 29 13:11:27 2015 -0700

----------------------------------------------------------------------
 .../gemfire/cache/client/internal/ConnectionFactoryImpl.java  | 7 +++----
 .../gemfire/cache/client/internal/ConnectionImpl.java         | 6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ecb91a0/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
index 7538b04..02a1fc0 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
@@ -20,9 +20,8 @@ import com.gemstone.gemfire.cache.client.ServerRefusedConnectionException;
 import com.gemstone.gemfire.cache.client.internal.ServerBlackList.FailureTracker;
 import com.gemstone.gemfire.cache.wan.GatewaySender;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.PoolCancelledException;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
-import com.gemstone.gemfire.internal.cache.PoolManagerImpl;
 import com.gemstone.gemfire.internal.cache.tier.Acceptor;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientUpdater;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
@@ -54,7 +53,7 @@ public class ConnectionFactoryImpl implements ConnectionFactory {
   private final CancelCriterion cancelCriterion;
   private ConnectionSource source;
   private int readTimeout;
-  private DistributedSystem ds;
+  private InternalDistributedSystem ds;
   private EndpointManager endpointManager;
   private GatewaySender gatewaySender;
   private PoolImpl pool;
@@ -67,7 +66,7 @@ public class ConnectionFactoryImpl implements ConnectionFactory {
   public static boolean testFailedConnectionToServer = false;
     
   public ConnectionFactoryImpl(ConnectionSource source,
-      EndpointManager endpointManager, DistributedSystem sys,
+      EndpointManager endpointManager, InternalDistributedSystem sys,
       int socketBufferSize, int handShakeTimeout, int readTimeout,
       ClientProxyMembershipID proxyId, CancelCriterion cancelCriterion,
       boolean usedByGateway, GatewaySender sender,long pingInterval,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ecb91a0/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionImpl.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionImpl.java
index 43cff54..749a765 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionImpl.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionImpl.java
@@ -71,7 +71,7 @@ public class ConnectionImpl implements Connection {
   private short wanSiteVersion = -1;//In Gateway communication version of connected wan site
                                    //will be stored after successful handshake
 //  private final CancelCriterion cancelCriterion;
-  private final DistributedSystem ds;
+  private final InternalDistributedSystem ds;
 
   private OutputStream out;
   private InputStream in;
@@ -80,7 +80,7 @@ public class ConnectionImpl implements Connection {
 
   private HandShake handShake;
 
-  public ConnectionImpl(DistributedSystem ds, CancelCriterion cancelCriterion) {
+  public ConnectionImpl(InternalDistributedSystem ds, CancelCriterion cancelCriterion) {
 //    this.cancelCriterion = cancelCriterion;
     this.ds = ds;
   }
@@ -90,7 +90,7 @@ public class ConnectionImpl implements Connection {
       int handShakeTimeout, int readTimeout, byte communicationMode, GatewaySender sender)
       throws IOException {
     SocketCreator sc = SocketCreator.getDefaultInstance();
-    DistributionConfig config = InternalDistributedSystem.getConnectedInstance().getConfig();
+    DistributionConfig config = ds.getConfig();
     if (communicationMode == Acceptor.GATEWAY_TO_GATEWAY) {
       sc = SocketCreator.createNonDefaultInstance(config.getGatewaySSLEnabled(),
           config.getGatewaySSLRequireAuthentication(), config.getGatewaySSLProtocols(),