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

session -> setResponder not thread safe

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.5
    • Fix Version/s: 1.0.5
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Windows / Unix

      Description

      setResponder is not synchronized (responder not volatile) and called from a different thread to hasResponder.

      Although hasResponder is synchronized and will get the latest version from main memory dropping its thread cache , there is no obvious guarantee that the thread calling setResponder has hit a memory barrier and forced its new responder value to main memory so hasResponder method can return an unexpected result as it will get the latest one from memory but not from the other threads cache that may not have been pushed to main memory yet.

      change setResponder to be synchronized.

      public synchronized void setResponder(Responder responder)

        Attachments

          Activity

            People

            • Assignee:
              admin Steve Bate
              Reporter:
              chris hurst Christopher Hurst
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: