Skip to content

Commit

Permalink
Merge pull request apache#3141 from apache/feature/GEODE-6344
Browse files Browse the repository at this point in the history
GEODE-6344: should revert GEODE-1183 before a better fix
  • Loading branch information
gesterzhou authored Jan 31, 2019
2 parents 1a6ca26 + 7d4b74c commit 366bcca
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,33 +512,25 @@ private CacheClientProxy registerClient(Socket socket, ClientProxyMembershipID p
}
} else {
CacheClientProxy staleClientProxy = this.getClientProxy(proxyId);
boolean toCreateNewProxy = true;
if (staleClientProxy != null) {
if (staleClientProxy.isConnected() && staleClientProxy.getSocket().isConnected()) {
successful = false;
toCreateNewProxy = false;
// A proxy exists for this non-durable client. It must be closed.
if (logger.isDebugEnabled()) {
logger.debug(
"CacheClientNotifier: A proxy exists for this non-durable client. It must be closed.");
}
if (staleClientProxy.startRemoval()) {
staleClientProxy.waitRemoval();
} else {
// A proxy exists for this non-durable client. It must be closed.
if (logger.isDebugEnabled()) {
logger.debug(
"CacheClientNotifier: A proxy exists for this non-durable client. It must be closed.");
}
if (staleClientProxy.startRemoval()) {
staleClientProxy.waitRemoval();
} else {
staleClientProxy.close(false, false); // do not check for queue, just close it
removeClientProxy(staleClientProxy); // remove old proxy from proxy set
}
staleClientProxy.close(false, false); // do not check for queue, just close it
removeClientProxy(staleClientProxy); // remove old proxy from proxy set
}
} // non-null stale proxy

if (toCreateNewProxy) {
// Create the new proxy for this non-durable client
l_proxy =
new CacheClientProxy(this, socket, proxyId, isPrimary, clientConflation, clientVersion,
acceptorId, notifyBySubscription, this.cache.getSecurityService(), subject);
successful = this.initializeProxy(l_proxy);
}
// Create the new proxy for this non-durable client
l_proxy =
new CacheClientProxy(this, socket, proxyId, isPrimary, clientConflation, clientVersion,
acceptorId, notifyBySubscription, this.cache.getSecurityService(), subject);
successful = this.initializeProxy(l_proxy);
}

if (!successful) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.apache.geode.internal.cache.ha.HAContainerRegion;
import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
import org.apache.geode.internal.cache.tier.sockets.CacheServerTestUtil;
import org.apache.geode.internal.logging.LogService;
import org.apache.geode.test.dunit.LogWriterUtils;
import org.apache.geode.test.dunit.SerializableRunnable;
import org.apache.geode.test.dunit.VM;
Expand Down Expand Up @@ -192,13 +191,17 @@ public void doMultipleCacheServer(boolean durable) throws Exception {
int serverPort = createCacheServerWithCSC(vm2, true, 3, "entry", "DEFAULT");
checkCacheServer(vm2, serverPort, true, 3);

// create cache server 2
final int serverPort2 = createCacheServerWithCSC(vm2, false, 0, null, null);
// Currently, only the first cache server's overflow attributes will take effect
// It will be enhanced in GEODE-1102
checkCacheServer(vm2, serverPort2, true, 3);
LogService.getLogger().info("receiverPort=" + receiverPort + ",serverPort=" + serverPort
+ ",serverPort2=" + serverPort2);
/*
* GEODE-6344: not to create the 2nd cacheserver on the same jvm until refix of GEODE-1183,
* otherwise the test might be hang
* // create cache server 2
* final int serverPort2 = createCacheServerWithCSC(vm2, false, 0, null, null);
* // Currently, only the first cache server's overflow attributes will take effect
* // It will be enhanced in GEODE-1102
* checkCacheServer(vm2, serverPort2, true, 3);
* LogService.getLogger().info("receiverPort=" + receiverPort + ",serverPort=" + serverPort
* + ",serverPort2=" + serverPort2);
*/

vm3.invoke(() -> createClientWithLocator(nyPort, "localhost", getTestMethodName() + "_PR",
"123", durable));
Expand All @@ -219,8 +222,11 @@ public void doMultipleCacheServer(boolean durable) throws Exception {
verifyRegionSize(vm4, NUM_KEYS);
verifyRegionSize(vm3, NUM_KEYS);

// close a cache server, then re-test
vm2.invoke(() -> closeACacheServer(serverPort2));
/*
* GEODE-6344
* // close a cache server, then re-test
* vm2.invoke(() -> closeACacheServer(serverPort2));
*/

vm5.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", NUM_KEYS * 2));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.Iterator;
import java.util.List;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

Expand Down Expand Up @@ -48,6 +49,7 @@ public Simple2CacheServerDUnitTest() {
super();
}

@Ignore // wait to re-fix GEODE-1183
@Test
public void testNormalClient2MultipleCacheServer() throws Exception {
doMultipleCacheServer(false);
Expand Down

0 comments on commit 366bcca

Please sign in to comment.