Details
-
Enhancement
-
Resolution: Won't Do
-
Major
-
None
-
None
Description
An ObjectMessage accepts objects of type SizeStreamable. When such an object has an incorrect serializableSize() method, the following can happen:
- Say the serialized size is 1000, but serializedSize() returns 1200
- When the ObjectMessage is serialized, a length of 1200 is written, but then only 1000 bytes are serialized onto the output stream
- On the receiving side, length=1200 is read and a byte array of 1200 is created
- DataInput.readFully() reads 1000 bytes, but then reaches the eof of the stream, trying to read an additional 200 bytes
- An exception is thrown and the reading of the message fails
If we caught the exception, things would work, however this would mask other errors in the object serialization/deserialization code.
If the serialization code was able to mark the position of the output stream, then we could write the actual number of bytes written (especially if it differs from serializedSize()); however, DataOutput doesn't give us this option!
Investigate whether simply catching (and ignoring) the EOFException would work.
Attachments
Issue Links
- relates to
-
JGRP-2289 FRAG4: handle ObjectMessage whose size() method is incorrect
- Resolved