-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
Workaround Exists
-
If read(byte[] buf, int offset, int len) is invoked on a StateInputStream, we do the following:
- stateQueue.take() is called to grab the next message (block if no message is available)
- Then we return the byte[] buffer of the message. The number of bytes returned is buffer.length, not len !
This has 3 issues:
#1 It violates the contract of read(): if we wanted to read len bytes at most, we cannot get more bytes back. E.g. if we wanted to read 500 bytes, but get 1000 back, then that's incorrect
#2 If we allocate a buffer of 500 bytes, but the next message has 1000 bytes, we will get an array out of bounds exception
#3 Even if this was correct, if we wanted to read 500 bytes, but the next message has 1000 bytes, we'd only read 500 bytes and throw the remainder away !
- is related to
-
JGRP-1013 STATE_TRANSFER / STREAMING_STATE_TRANSFER: close BARRIER before applying state response
- Resolved