Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-852

Missing synchronized blocks discovered in code review.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Default
    • Resolution: Unresolved
    • Affects Version/s: 1.6.0
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:

      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)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nathantippy Nathan Tippy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: