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

Template-based FIX sessions get disconnected on first logon

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I have a custom AcceptorSessionProvider similar to DynamicAcceptorSessionProvider.

      The Sessions that get created on-the-fly at Logon time sometimes get disconnected right away. If the SessionID has never been seen before, it works fine. The disconnect only happens if the MessageStore has a previous *.session file lying around from a previous day. Subsequent logons by the same client work fine.

      The problem was that Session.checkSessionTime always returns false in the constructor, and it caches this result for 1 second. The fix is to NOT cache a negative result. Apologies for my bad habit of posting patches here in the description, but it seems silly to attach a file when the fix is just a single line change:

      Index: core/src/main/java/quickfix/Session.java
      ===================================================================
      — core/src/main/java/quickfix/Session.java (revision 950)
      +++ core/src/main/java/quickfix/Session.java (working copy)
      @@ -489,7 +489,7 @@
      // necessary to do for every message received.
      //
      Date date = SystemTime.getDate();

      • if ((date.getTime() - lastSessionTimeCheck) >= 1000L) {
        + if (!lastSessionTimeResult || (date.getTime() - lastSessionTimeCheck) >= 1000L) {
        Date getSessionCreationTime = state.getCreationTime();
        lastSessionTimeResult = sessionSchedule.isSameSession(SystemTime.getUtcCalendar(date),
        SystemTime.getUtcCalendar(getSessionCreationTime));

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                seh4nc Scott Harrington
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: