[QFJ-30] Weekly session does not work Created: 19/Jun/06 Updated: 12/Sep/06 Resolved: 15/Jul/06 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | Engine |
Affects Version/s: | 1.0.0 Final |
Fix Version/s: | 1.0.2 |
Type: | Bug | Priority: | Major |
Reporter: | Christian Braeuner | Assignee: | Steve Bate |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Environment: |
Windows XP, Sun JVM 1.4.2_06 |
Description |
When a weekly session is configured, quickfixj would stop and start sessions on other weekdays than the one configured. In my particular case I have a session that is reset on a Friday afternoon, so quickfixj was configured for a weekly session lasting from Friday 16:00 to Friday next week 13:00. Errors in the calculation made it log out, reset and log in on other weekdays as well. Here are suggested code changes: SessionSchedule.java line 221: if (time1Range == 0) {
if (time2Range == 0) {
SessionSchedule.java line 262: if (startDay == endDay) {
} else if (startDay < endDay) { Christian |
Comments |
Comment by Steve Bate [ 15/Jul/06 ] |
I've redesigned the SessionSchedule class and changed the algorithm for calculating weekly schedules. I also added a test to look for problems with week-long schedule by periodically checking the schedule throughout a simulated weeklong time period. I used your schedule as the test case. It appears to work well now. The changes are on the branch: QFJ_RELEASE_1_0_x (and merged to the trunk). |
Comment by Christian Braeuner [ 24/Aug/06 ] |
Hi Steve, unfortunately there are different problems with the new SessionSchedule it seems. I've had 2 resets during in the middle of the active weekly schedule. My schedule is from Friday 22:00 to Friday next week 18:00, i.e. there is only a 4h down time in which the session is reset. |
Comment by Christian Braeuner [ 04/Sep/06 ] |
Hi Steve, sorry, I wasn't clear on my previous comment. I have tried your version 1.0.2 and your change has got a different problem now in that the weekly session is reset when it shouldn't . |
Comment by Steve Bate [ 04/Sep/06 ] |
Hi Christian, I'd really like to know what's happening here (I'm guessing you feel the same way ). I have a unit test that scans an entire week every at an interval of 5 seconds (configurable if we want 1 second test resolution, but the test is then slow) and ensures the session schedule gives the correct information about session boundaries. The test is SessionScheduleTest.testWeeklyPeriodically(). Do you have any ideas about how to use a test case to reproduce the problem you are seeing? |
Comment by Christian Braeuner [ 04/Sep/06 ] |
Hi Steve, Thanks for your efforts so far. I could have something to do with boundary conditions when it switches over, but have you tried combining that with different "last session creation time" values? I am sure it has something to do with different combinations of local time, last session creation time and the active schedule. Session schedule Last created Now Active Reset Then combine 'now' times above with different 'last created' times below You can also combine the combinations above with different weekly session schedules, but the one above is the case I am using. I am using the standard time zone, i.e. UTC. Wed 14:00 - Wed 12:00 I think that would exhaustively cover all possible combinations that I can think of. I haven't looked at your unit tests, but I guess you are doing something similar and my hope is that you've missed something out. Maybe you can compare your schedules with mine and hopefully we'll find a gap in the existing tests that my connection fails on. Otherwise it is going to be difficult to explain and I'd have to try your version again, put some debug output in there and hope it fails soon. But it is safer to reproduce it with a full set of tests. |
Comment by Steve Bate [ 12/Sep/06 ] |
Hello, I've tried many different combinations of tests and I still can't reproduce the problem. I currently have a test case that tests a range of schedule start/end combinations, session creation times and current times. There are literally thousands of tests and I'm almost sure they include all the cases you listed above. I also created tests specifically for many, but not all, of the specific scenarios you listed and they passed. I'm beginning to wonder if the problem is at a higher level, possibly in the session logic that uses the session schedule. |