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

Weekly session fails on Sundays

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0.5
    • Fix Version/s: 1.2.0
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Unix Sun JVM 1.4.2_06 and XP Sun JVM 1.6.0_01

      Description

      When the weekly Session starts on a Sunday, the QF engine resets but does not start at the configured time.
      This is quite a serious error for Reuters because the bug has made it into our production system because production has a different Schedule than development. The production system now needs to be started manually with temporary config changes every Sunday evening until we can deploy a fix.

      The SessionSchedule class has a bug in TimeInterval.theMostRecentIntervalBefore() when the start or end date is a Sunday. The following code is making the wrong assumptions:
      if (startTime.getDay() != -1) {
      startCal.set(Calendar.DAY_OF_WEEK, startTime.getDay());
      }
      This code and the equivalent for endCal assume that the calendar moves backward if startTime is less than the current setting and moves forward if startTime is later than the current setting. I.e. if startCal is Wednesday=4 then the calendar would move back if set to Sunday=1 and forward if set to Friday=5. This is not the always the case and depends on Calendar.getFirstDayOfWeek(). In our case the first day of the week is Monday=2. So for example when the current date is Thu Apr 19 and the session starts on Sunday, then startCal(Calendar.DAY_OF_WEEK, 1) is not moving backwards to Sun 15 Apr, but forwards to Sun 22 Apr, because the week is 2,3,...,6,7,1. This is then returning the wrong interval and prevents the adapter from starting up.

      The fix is to insert startCal.setFirstDayOfWeek(1) and endCal.setFirstDayOfWeek(1) at the appropiate lines in this method.

      Regards,
      Christian

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                admin Steve Bate
                Reporter:
                c_braeuner Christian Braeuner
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: