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

Response to TestRequest received before the SessionState is updated

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.3
    • Component/s: Engine
    • Labels:
      None

      Description

      The problem: When a response to TestRequest is received too quickly, a false positive heartbeat timeout happens and causes disconnection.

      In method quickfix.Session.next() there exists the following code:

      if (state.isTestRequestNeeded())

      { generateTestRequest("TEST"); state.incrementTestRequestCounter(); getLog().onEvent("Sent test request TEST"); stateListener.onMissedHeartBeat(); }

      else if (state.isHeartBeatNeeded())

      { generateHeartbeat(); }

      In this code,
      generateTestRequest("TEST");
      sends the Test Request, a response to which can be received before line
      state.incrementTestRequestCounter();
      is executed.

      Whenever this condition happens, there is always a false disconnect due to missed heartbeats (assuming the server does not send unsolicited heartbeats)

      (why this happens:

      • quickfix.SessionState.isTestRequestNeeded() returns false up until 3*[heart beat interval]
      • quickfix.SessionState.isTimedOut() returns false only up until 2.4*[heart beat interval]
      • state.isTimedOut() returns true before state.isTestRequestNeeded(), so another TestRequest is not sent before the timeout causes the disconnection.

      Note: it is not a theoretical issue, the problem does occur time to time

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alexrat aleksey ratushnyy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: