[QFJ-926] Session reset happens after logon Created: 23/May/17 Updated: 23/Dec/19 Resolved: 03/Jul/17 | 
    |
| Status: | Closed | 
| Project: | QuickFIX/J | 
| Component/s: | Engine | 
| Affects Version/s: | 1.6.0 | 
| Fix Version/s: | 1.6.4 | 
| Type: | Bug | Priority: | Major | 
| Reporter: | Nickolay Dul | Assignee: | Christoph John | 
| Resolution: | Fixed | Votes: | 0 | 
| Labels: | None | ||
| Issue Links: | 
                
  | 
        ||||||||
| Description | 
| 
             scenario: application is handling several FIX sessions (initiators)  {{11 May 23:40:10.450 INFO (Thread-3) Session FIX.4.4:SENDER_ONE->TARGET schedule is THU 04:05:00-UTC - THU 20:30:00-UTC 11 May 23:40:10.501 INFO (Thread-3) Session FIX.4.4:SENDER_TWO->TARGET schedule is THU 04:07:00-UTC - THU 20:30:00-UTC on the next day logons are initiated according to session’s schedules but the first session reset is happened in the middle of message handling: 
 on other hand second session starts normally (reset happens before logon): 
 I guess the problem is how session reset is handled in Session::next() method:  | 
    
| Comments | 
| Comment by Nickolay Dul [ 23/May/17 ] | 
| 
             I guess the problem is how session reset is handled in Session::next() method: if (sessionSchedule != null && !sessionSchedule.isNonStopSession()) { // Only check the session time once per second at most. It isn't // necessary to do for every message received. final long now = SystemTime.currentTimeMillis(); if ((now - lastSessionTimeCheck) >= 1000L) { lastSessionTimeCheck = now; if (!isSessionTime()) { if (state.isResetNeeded()) { reset(); // only reset if seq nums are != 1 } return; // since we are outside of session time window } else { resetIfSessionNotCurrent(sessionID, now); } } }  | 
| Comment by Nickolay Dul [ 23/May/17 ] | 
| 
             extra question:  12 May 06:05:00.932 INFO (QFJ Timer) Initiated logon request 12 May 06:05:01.156 INFO (QFJ Message Processor) Session state is not current; resetting FIX.4.4:SENDER_ONE->TARGET  | 
| Comment by Nickolay Dul [ 23/May/17 ] | 
| 
             still have no reliable fix for this (just because not very familiar with QuickFIX/J code) perhaps we should add additional check - like: 
if ((now - lastSessionTimeCheck) >= 1000L || (!state.isLogonReceived() && state.isLogonSendNeeded())) {
 | 
| Comment by Christoph John [ 03/Jul/17 ] | 
| 
             Hi Nickolay Dul,  | 
| Comment by Christoph John [ 03/Jul/17 ] | 
| 
             Is now corrected for initiators and acceptors.  |