RE: [Quickfix-developers] RE: Session *NOT* Resetting
Brought to you by:
orenmnero
|
From: Steinberg, J. <Jon...@bo...> - 2006-03-08 18:37:50
|
I'll try giving it a shot.
In the meantime, tell me if this analysis is reasonable:
Assuming (according to your response) that it is checkSessionTime which
is responsible for triggering the reset:
bool checkSessionTime( const UtcTimeStamp& time )
{
UtcTimeStamp creationTime = m_state.getCreationTime();
return m_sessionTime.isSameSession(time, creationTime);
}
I see it depends on
m_sessionTime.isSameSession:
bool isSameSession( const UtcTimeStamp& time1, const UtcTimeStamp& time2
)
{
if( m_startDay < 0 && m_endDay < 0 )
return isSameSession( m_startTime, m_endTime, time1, time2 );
else
return isSameSession
( m_startTime, m_endTime, m_startDay, m_endDay, time1, time2 );
}
now since I am not using week-long sessions, the call to
isSameSession( m_startTime, m_endTime, time1, time2 );
is used.
My session start time is 10:00 (5 am est)
My session end time is 02:00:00 (9 pm est)
bool SessionTime::isSameSession( const UtcTimeOnly& start,
const UtcTimeOnly& end,
const UtcTimeStamp& time1,
const UtcTimeStamp& time2 )
{ QF_STACK_PUSH(SessionTime::isSameSession)
if( !isSessionTime( start, end, time1 ) ) return false;
if( !isSessionTime( start, end, time2 ) ) return false;
if( time1 == time2 ) return true;
UtcDate time1Date( time1 );
UtcDate time2Date( time2 );
if( start < end || start == end )
return time1Date == time2Date;
else if( start > end )
return labs( time1 - time2 ) < DateTime::SECONDS_PER_DAY;
return false;
QF_STACK_POP
}
Since start > end, the session will always restart when
return labs( time1 - time2 ) < DateTime::SECONDS_PER_DAY;
which means that the session will always get reset at exactly 24 hours
after the last session creation, but *not* at session start time., which
is a problem;
Day one, my session starts at 5:00:14.
Next day, the session starts up at 5:00:11. 3 sconds later it's
resetting itself, causing my problems.
Am I right, or am I left?
Assuming this is correct, I am going to work around it by changing the
session end time to 11:59:00,
thus having start<end in isSameSession and my session will not reset
during the same day (time1Date == time2Date) .
Please let me know if this is correct. My dropped sessions are driving
me nuts.
Thanks for the help
Jonathan Steinberg
-----Original Message-----
From: Oren Miller [mailto:or...@qu...]
Sent: Wednesday, March 08, 2006 9:40 AM
To: Steinberg, Jonathan
Cc: John Hensley; qui...@li...
Subject: Re: [Quickfix-developers] RE: Session *NOT* Resetting
Can you log what is going on in checkSessionTime?
--oren
Steinberg, Jonathan wrote:
> I think I fixed my original problem, but I'm still having issues with
> the reliability of my sessions.
>
> (QuckFix 1.11.0 C# application using quickfix_net wrapper dll, VS
> 2003, Windows 2003 server)
>
> Here's what happened today.
>
> When My session started up at 5 AM , apparently the session did not
> get reset;
>
> Here's the event log:
>
> 2006-03-06 05:00:11.290 Connecting to xx.xx.xx.xxx on port yyyy
>
> 2006-03-06 05:00:12.353 Connection succeeded
>
> 2006-03-06 05:00:15.050 PURGING MESSAGES
>
> 2006-03-06 05:00:15.067 Updating Session: Old Session creation time
> :Mar 3 2006 10:00AM
>
> 2006-03-06 05:00:15.067 UPDATING SESSION INFO: CreationTime Mar 6 2006
> 10:00AM incoming seq: 1 outgoing seq: 1
>
> 2006-03-06 05:00:16.993 Initiated logon request
>
> 2006-03-06 05:00:17.290 Received logon response
>
> 2006-03-06 18:00:01.097 Received logout request
>
> 2006-03-06 18:00:01.173 Sending logout response
>
> 2006-03-06 18:00:01.173 Disconnecting
>
> 2006-03-06 18:00:01.220 Socket Error
>
> 2006-03-06 18:00:11.000 Connecting to xx.xx.xx.xxx on port yyyy
>
> 2006-03-06 18:00:12.047 Connection failed
>
> (The Purging messages and updating session entries are the logging I
> added to diagnose my earlier problem (The 10:AM in the log msgs really
> is 5:AM ET- I left the UTC in the log message))
>
> Here are my incoming and outgoing logs (I'm BFPG the counterparty is
BOFA)
>
> 2006-03-07 05:00:12.803
>
8=FIX.4.09=6135=A34=78249=BFPG52=20060307-10:00:1256=BOFA98=0108=6010=20
3
>
> 2006-03-07 05:00:13.227
>
8=FIX.4.09=6435=A49=BOFA56=BFPG34=143=N52=20060307-10:00:1298=0108=6010=
081
>
> 2006-03-07 05:00:14.540
> 8=FIX.4.09=10035=534=78349=BFPG52=20060307-10:00:1456=BOFA58=MsgSeqNum
> too low, expecting 932 but received 110=211
>
> 2006-03-07 05:00:14.650
>
8=FIX.4.09=6335=249=BOFA56=BFPG34=243=N52=20060307-10:00:127=116=78110=0
17
>
> 2006-03-07 05:00:43.177
>
8=FIX.4.09=5935=A34=149=BFPG52=20060307-10:00:4356=BOFA98=0108=6010=102
>
> 2006-03-07 05:00:43.320
>
8=FIX.4.09=17635=549=BOFA56=BFPG34=343=N52=20060307-10:00:4358=Catastrop
ic
> Error: Incoming sequence number (1) is less than expected (784)
> without PossDupFlag being set. Logging out.10=051
>
> 2006-03-07 05:00:43.413
> 8=FIX.4.09=4749=35=534=2BFPG52=20060307-10:00:4356=BOFA10=060
>
> Here is how I read this:
>
> The session did not reset at 5, but rather tried to logon with the
> prior sequence numbers.
>
> This caused my session to reject the counter party's logon response,
> which had properly reset their sequence number 1.
>
> At the same time, the counter party sends a resend request.
>
> All this happens before 05:00:15
>
> Then suddenly at 05:00:15 the session does reset itself, causing the
> counter party to reject, as it's not expecting it now.
>
> Why is the session not resetting at the session start time?
>
> Any help would be much appreciated.
>
> Jonathan Steinberg
>
|