You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by zh...@apache.org on 2020/06/16 04:51:52 UTC
[geode] branch feature/GEODE-8259 created (now 25e52fd)
This is an automated email from the ASF dual-hosted git repository.
zhouxj pushed a change to branch feature/GEODE-8259
in repository https://gitbox.apache.org/repos/asf/geode.git.
at 25e52fd GEODE-8259: DSFIDSerializerImpl should handle RTE the same as Exception
This branch includes the following new commits:
new 25e52fd GEODE-8259: DSFIDSerializerImpl should handle RTE the same as Exception
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[geode] 01/01: GEODE-8259: DSFIDSerializerImpl should handle RTE
the same as Exception
Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zhouxj pushed a commit to branch feature/GEODE-8259
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 25e52fdf354fd5fefac89f6fb58efe0458e7c60b
Author: zhouxh <gz...@pivotal.io>
AuthorDate: Mon Jun 15 21:50:34 2020 -0700
GEODE-8259: DSFIDSerializerImpl should handle RTE the same as Exception
---
.../internal/cache/execute/PRClientServerTestBase.java | 4 ++--
.../cache/execute/SingleHopGetAllPutAllDUnitTest.java | 16 ++++++++++++++--
.../geode/cache/client/internal/OpExecutorImpl.java | 3 +++
.../cache/tier/sockets/VersionedObjectList.java | 18 +++++++++++++++++-
.../serialization/internal/DSFIDSerializerImpl.java | 4 ++--
5 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java
index 8e7b7ce..2b447a1 100755
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java
@@ -140,7 +140,7 @@ public class PRClientServerTestBase extends JUnit4CacheTestCase {
paf.setColocatedWith((String) commonAttributes.get(4));
paf.setLocalMaxMemory(localMaxMemory);
PartitionAttributes partitionAttributes = paf.create();
- factory.setDataPolicy(DataPolicy.PARTITION);
+ factory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
factory.setPartitionAttributes(partitionAttributes);
RegionAttributes attrs = factory.create();
@@ -329,7 +329,7 @@ public class PRClientServerTestBase extends JUnit4CacheTestCase {
p = PoolManager.createFactory().addServer(host, port1)
.addServer(host, port2).addServer(host, port3).setPingInterval(2000)
.setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setReadTimeout(2000)
- .setSocketBufferSize(1000).setMinConnections(6).setMaxConnections(10).setRetryAttempts(2)
+ .setSocketBufferSize(1000).setMinConnections(6).setMaxConnections(10)
.setPRSingleHopEnabled(true).create("PRClientServerTestBase");
} finally {
CacheServerTestUtil.enableShufflingOfEndpoints();
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
index 1887bc4..b1a6c01 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java
@@ -23,6 +23,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
@@ -33,7 +34,9 @@ import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.internal.cache.BucketServerLocation66;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.LocalRegion;
-
+import org.apache.geode.internal.cache.tier.sockets.VersionedObjectList;
+import org.apache.geode.logging.internal.log4j.api.LogService;
+import org.apache.geode.test.dunit.VM;
/**
* This class tests single-hop bulk operations in client caches. Single-hop makes use
@@ -47,6 +50,8 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase {
private static final long serialVersionUID = 3873751456134028508L;
+ private static final Logger logger = LogService.getLogger();
+
public SingleHopGetAllPutAllDUnitTest() {
super();
@@ -65,6 +70,9 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase {
*/
@Test
public void testGetAllInClient() {
+ for (VM vm : new VM[] {client, server1, server2, server3}) {
+ vm.invoke(() -> VersionedObjectList.isNormal = false);
+ }
client.invoke("testGetAllInClient", () -> {
Region<Integer, Object> region = cache.getRegion(PartitionedRegionName);
assertThat(region).isNotNull();
@@ -90,14 +98,18 @@ public class SingleHopGetAllPutAllDUnitTest extends PRClientServerTestBase {
((GemFireCacheImpl) cache).getClientMetadataService()
.getTotalRefreshTaskCount_TEST_ONLY();
+ logger.info("GGG:start");
Map<Integer, Object> resultMap = region.getAll(testKeyList);
assertThat(resultMap).isEqualTo(origVals);
// a new refresh should not have been triggered
assertThat(((GemFireCacheImpl) cache).getClientMetadataService()
.getTotalRefreshTaskCount_TEST_ONLY())
- .isEqualTo(metadataRefreshes);
+ .isEqualTo(metadataRefreshes + 3);
});
+ for (VM vm : new VM[] {client, server1, server2, server3}) {
+ vm.invoke(() -> VersionedObjectList.isNormal = true);
+ }
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java
index c73bee0..4e15f46 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/OpExecutorImpl.java
@@ -331,6 +331,7 @@ public class OpExecutorImpl implements ExecutablePool {
try {
return executeWithPossibleReAuthentication(conn, op);
} catch (Exception e) {
+ // logger.info("GGG3:before handleException:" + e);
handleException(e, conn, 0, true);
// this shouldn't actually be reached, handle exception will throw something
throw new ServerConnectivityException("Received error connecting to server", e);
@@ -611,10 +612,12 @@ public class OpExecutorImpl implements ExecutablePool {
invalidateServer = false;
} else {
Throwable t = e.getCause();
+ // logger.info("GGG:handling SCE and SOE:cause=" + t + ":finalAttempt=" + finalAttempt);
if ((t instanceof IOException)
|| (t instanceof SerializationException) || (t instanceof CopyException)
|| (t instanceof GemFireSecurityException) || (t instanceof ServerOperationException)
|| (t instanceof TransactionException) || (t instanceof CancelException)) {
+ // logger.info("GGG:in IOException?, forceThrow:" + forceThrow + ":t=" + t);
handleException(t, conn, retryCount, finalAttempt, timeoutFatal);
return;
} else if (e instanceof ServerOperationException) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/VersionedObjectList.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/VersionedObjectList.java
index 5628f2d..8899198 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/VersionedObjectList.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/VersionedObjectList.java
@@ -63,6 +63,7 @@ import org.apache.geode.logging.internal.log4j.api.LogService;
public class VersionedObjectList extends ObjectPartList implements Externalizable {
private static final Logger logger = LogService.getLogger();
private static final long serialVersionUID = -8384671357532347892L;
+ public static boolean isNormal = true; // hack toData to pack wrong msg for the first time
ArrayList<VersionTag> versionTags;
@@ -425,20 +426,31 @@ public class VersionedObjectList extends ObjectPartList implements Externalizabl
InternalDataSerializer.invokeToData(tag, out);
} else {
Integer idNumber = ids.get(id);
- if (idNumber == null) {
+ if (idNumber == null && isNormal) {
out.writeByte(FLAG_TAG_WITH_NEW_ID);
idNumber = Integer.valueOf(idCount++);
ids.put(id, idNumber);
InternalDataSerializer.invokeToData(tag, out);
+ // logger.info("GGG:toData:FLAG_TAG_WITH_NEW_ID:idNumber=" + idNumber);
} else {
+ if (isNormal == false) {
+ idNumber = Integer.valueOf(idCount++);
+ }
out.writeByte(FLAG_TAG_WITH_NUMBER_ID);
tag.toData(out, false);
tag.setMemberID(id);
InternalDataSerializer.writeUnsignedVL(idNumber, out);
+ // logger.info("GGG:toData:FLAG_TAG_WITH_NUMBER_ID:idNumber=" + idNumber +
+ // ":isNormal="
+ // + isNormal);
}
}
}
}
+ if (isNormal == false) {
+ isNormal = true;
+ logger.info("GGG:isNormal is set to true");
+ }
}
}
@@ -501,10 +513,14 @@ public class VersionedObjectList extends ObjectPartList implements Externalizabl
VersionTag tag = VersionTag.create(persistent, in);
ids.add(tag.getMemberID());
this.versionTags.add(tag);
+ // logger.info("GGG:fromData:FLAG_TAG_WITH_NEW_ID:ids=" + ids + ":tag=" + tag);
break;
case FLAG_TAG_WITH_NUMBER_ID:
tag = VersionTag.create(persistent, in);
int idNumber = (int) InternalDataSerializer.readUnsignedVL(in);
+ // logger.info("GGG:fromData:FLAG_TAG_WITH_NUMBER_ID:idNumber=" + idNumber + ":ids=" +
+ // ids
+ // + ":tag=" + tag);
tag.setMemberID(ids.get(idNumber));
this.versionTags.add(tag);
break;
diff --git a/geode-serialization/src/main/java/org/apache/geode/internal/serialization/internal/DSFIDSerializerImpl.java b/geode-serialization/src/main/java/org/apache/geode/internal/serialization/internal/DSFIDSerializerImpl.java
index e44011b..0731938 100644
--- a/geode-serialization/src/main/java/org/apache/geode/internal/serialization/internal/DSFIDSerializerImpl.java
+++ b/geode-serialization/src/main/java/org/apache/geode/internal/serialization/internal/DSFIDSerializerImpl.java
@@ -338,8 +338,8 @@ public class DSFIDSerializerImpl implements DSFIDSerializer {
} catch (EOFException | ClassNotFoundException | SocketException ex) {
// client went away - ignore
throw ex;
- } catch (RuntimeException e) {
- throw e;
+ // } catch (RuntimeException e) {
+ // throw e;
} catch (Exception ex) {
throw new IOException(
String.format("Could not create an instance of %s .",