Closed sregueiroqb closed 2 months ago
I was working on unrelated changes in the area and I think there is a very small and simple fix @sregueiroqb would you mind reviewing the test in https://github.com/quickfix-j/quickfixj/pull/574 - I used reproducer from this issue, but had to make some changes to actually make it fail
Describe the bug We are connecting to an FX market that has an opening time on the Madrid timezone (at 00:00) and close time on the New York timezone (at 17:00), Monday to Friday, due to fixing reasons. The local time is UTC, the application runs in kubernetes. To avoid having to change the config when daylight savings changes, we setup the session the following way:
We want to connect 5 minutes before the session opens and disconnect 5 minutes after.
Using this configuration, results on the session connecting at 23:55 Madrid (21:55 UTC) and disconnecting at 00:00 Madrid (22:00 UTC), reconnecting again at 06:00 Madrid (04:00 UTC)
The issue is found in
DefaultSessionSchedule
.theMostRecentIntervalBefore
calculates the wrong interval when changing days and the close time is before open time.The log shows the correct schedule
[FIX.5.0:SENDER->TARGET] sunday, monday, tuesday, wednesday, thursday, 21:55:00-UTC - 21:05:00-UTC (sunday, monday, tuesday, wednesday, thursday, 23:55:00-MESZ - 17:05:00-EDT)
To Reproduce
Expected behavior The session connects and disconnects at the appropiate times.
system information: