dschneider-pivotal commented on a change in pull request #6561:
URL: https://github.com/apache/geode/pull/6561#discussion_r658324249



##########
File path: 
geode-core/src/main/java/org/apache/geode/cache/client/internal/QueryOp.java
##########
@@ -122,7 +123,18 @@ protected Object processResponse(Message msg) throws 
Exception {
           queryResult = resultPart.getObject();
         } catch (Exception e) {
           String s = "While deserializing " + getOpName() + " result";
-          if (e instanceof PdxSerializationException) {
+
+          // Enable the workaround to convert PdxSerializationException into 
IOException to retry.
+          // It only worked when the client is configured to connect to more 
than one cache server
+          // AND the pool's "retry-attempts" is -1 (the default which means 
try each server) or > 0.
+          // It is possible that if application closed the current connection 
and got a new
+          // connection to the same server and retried the query to it, that 
it would also
+          // workaround this issue and it would not have the limitations of 
needing multiple servers
+          // and would not depend on the retry-attempts configuration.
+          boolean enableQueryRetryOnPdxSerializationException = 
Boolean.getBoolean(
+              GeodeGlossary.GEMFIRE_PREFIX + 
"enableQueryRetryOnPdxSerializationException");
+          if (e instanceof PdxSerializationException
+              && enableQueryRetryOnPdxSerializationException) {

Review comment:
       I think it would also be good to log an info message in this block that 
a pdx serialization exception is being converted to an ioexception. We don't 
expect this to happen too often but it would be good in the customer case if 
they no longer see failures to know that they did reproduce the problem and the 
workaround saved them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to