hazelcast/hazelcast-python-client

[TRACKING ISSUE] Check for the minimum size of the bytes read only once per frame

hz-devops-test opened this issue · 0 comments

The tracking issue for the Java side PR.

See hazelcast/hazelcast#21502 for details.


Before this fix, while reading a message frame, we were mistakenly
checking that the bytes we haven't read yet are less than 6 bytes
each time the ClientMessageReader#readFrame is called.

This is problematic for frames that are read in multiple calls,
as the size of the last piece of the frame we are reading might be
actually less than 6 bytes and that is definitely valid. However,
in that case, we were not able to read the remaining part and
continue.

This PR aims to fix this problem by having that check only at the
beginning for each frame, only once per frame. Once we read the frame
length and flags, we will be able to read any number of bytes no
matter how small it is.