This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a commit to branch feature/GEODE-9346
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 37501226644b84466ab35bdfd2bf82149a581af7
Author: zhouxh <[email protected]>
AuthorDate: Thu Jun 3 13:47:41 2021 -0700

    GEODE-9346: When client received incorrect byte array of PdxType due to 
broken socket, it should be retried
---
 .../org/apache/geode/cache/client/internal/AbstractOp.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
 
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
index 7c40b9e..9d47ff7 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AbstractOp.java
@@ -35,6 +35,7 @@ import org.apache.geode.internal.logging.log4j.LogMarker;
 import org.apache.geode.internal.serialization.ByteArrayDataInput;
 import org.apache.geode.internal.serialization.KnownVersion;
 import org.apache.geode.logging.internal.log4j.api.LogService;
+import org.apache.geode.pdx.PdxSerializationException;
 
 /**
  * Represents an operation that can be performed in a client by sending a 
message to a server.
@@ -331,8 +332,14 @@ public abstract class AbstractOp implements Op {
     final int msgType = msg.getMessageType();
     if (msgType == MessageType.RESPONSE) {
       do {
-        msg.receiveChunk();
-        callback.handle(msg);
+        try {
+          msg.receiveChunk();
+          callback.handle(msg);
+        } catch (PdxSerializationException e) {
+          throw new IOException(
+              "Unexpected PdxSerializationException, it could be caused by 
broken socket, retrying...",
+              e);
+        }
       } while (!msg.isLastChunk());
     } else {
       if (msgType == MessageType.EXCEPTION) {

Reply via email to