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



##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/ReplyMessage.java
##########
@@ -295,14 +307,7 @@ public void toData(DataOutput out,
       out.writeInt(processorId);
     }
     if (this.returnValueIsException || this.returnValue != null) {
-      try {
-        context.getSerializer().writeObject(this.returnValue, out);
-      } catch (NotSerializableException e) {
-        // When this happens data has already been written to the output 
stream for the
-        // non-serializable object. The recipient will get a 
java.io.WriteAbortedException when
-        // attempting to deserialize the value, so we handle that in fromData()
-        logger.warn("Unable to send a reply to " + getRecipientsDescription(), 
e);
-      }
+      context.getSerializer().writeObject(this.returnValue, out);

Review comment:
       when you serialized to hdos it has all the serialized bytes of 
"this.returnValue". So you don't want to serialize them again here. Instead 
just copy those bytes to "out". So change this line to "hdos.sendTo(out);". You 
still need to do this here if the serialization above failed so in the 
NotSerializableException catch set a boolean "failedSerialization" to true that 
you can test here.




-- 
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