Details
Description
In the class Session in the following method
private boolean verify(Message msg, boolean checkTooHigh, boolean checkTooLow)
we find that synchronized (state.getLock()) is used to ensure atomic updates to the multiple fields in the state object. If this is needed then we must also check to ensure partial or dirty reads are avoided. This would happen any place that we call for more than one field of the state and assume the fields remain consistent with one another until we make a second or third request for other fields.
Directly after this same block the usage of isChunkedResendRequest, getCurrentEndSeqNo and getEndSeqNo run the risk of partial (dirty) reads because they are out side the sync.
This same problem also exists here where it may be the cause of other more serious issues.
private void nextSequenceReset(Message sequenceReset)
And to a a lesser degree in
private void doTargetTooHigh(Message msg)