[Quickfix-developers] FieldConvertError not caught in Session::insertSendingTime()
Brought to you by:
orenmnero
From: Brendan B. B. <br...@ka...> - 2004-09-22 15:24:17
|
Hi, I have an app running on Linux which submits some FIX42::QuoteRequests and accepts any incoming FIX42::Quotes. Periodically I've noticed that the app will terminate due to an uncaught exception. I enabled ENABLE_CALLSTACK and found this after the last occurence: thread(1026):N3FIX17FieldConvertErrorE: Could not convert field at time_gmtime(Utility.cpp:282) at Session::insertSendingTime(Session.cpp:81) at Session::fill(Session.cpp:98) at Session::generateHeartbeat(Session.cpp:602) at Session::next(Session.cpp:112) at SocketConnection::onTimeout(SocketConnection.cpp:214) at SocketInitiator::onTimeout(SocketInitiator.cpp:189) at ConnectorWrapper::onTimeout(SocketConnector.cpp:76) at SocketMonitor::block(SocketMonitor.cpp:141) at SocketConnector::block(SocketConnector.cpp:120) at SocketInitiator::onStart(SocketInitiator.cpp:69) at Initiator::startThread(Initiator.cpp:217) Debugging through the CallStack code I think the "time_gmtime(Utility.cpp:282)" is in error - it didn't abend but wasn't removed from the CallStack before calling: UtcTimeStampConvertor::convert(now, m_millisecondsInTimeStamp) (I didn't have MillisecondsInTimeStamp=N in my settings file). UtcTimeStampConvertor::convert(UtcTimeStamp &, bool) throws a FieldConvertError if strftime() produces an unexpected result or if adding the millsecs doesn't result in 3 chars. I've added some debugging couts << but wouldn't you know, the problem hasn't reproduced since :-(. I can't see why UtcTimeStampConvertor::convert() should be throwing a convert error for current time (unless somehow m_ms > 1000?), but it might be advisable to catch the FieldConvertError in Session::insertSendingTime(Header &) and retry... Regards, Brendan |