[Quickfix-developers] Incoming messages processed with delay
Brought to you by:
orenmnero
From: <ily...@bn...> - 2008-07-17 09:22:50
|
Hi all, We've been using Quickfix for a very long time now, and we're run across a very unusual problem recently. We're using an older version of the library for this connection (it's embarrassing, but I can't tell you which, as I'm not the developer on this - but I do see that the code changed a lot since - please see the code extract below), and I'm basically trying to find out whether this is a known bug, and whether upgrading to the latest version of the library would solve our problem. When receiving messages from one of our counterparty, messages get processed with a rather important delay. Here are the logs we have: 15/07/2008 09:03:41:412;INFO;FIX recv size:73 15/07/2008 09:03:41:412;INFO;FIX Waiting for data... 15/07/2008 09:03:41:412 QFIX IN 8=FIX.4.29=004935=049=xxx56=yyy34=1757 52=20080715-01:03:4110=034 15/07/2008 09:03:41:414;INFO;Received HeartBeat SeqNum: 1757 15/07/2008 09:03:41:414;INFO;Sending to EP... 15/07/2008 09:03:41:415;INFO;Sending to EP...OK 15/07/2008 09:03:41:415;INFO;DB update incoming seqnum 1758... 15/07/2008 09:03:41:429;INFO;DB update incoming seqnum 1758...OK 15/07/2008 09:03:41:429;INFO;DB store incoming... 15/07/2008 09:03:41:444;INFO;DB store incoming...Ok 15/07/2008 09:04:01:411;INFO;FIX recv size:73 15/07/2008 09:04:01:412;INFO;FIX Waiting for data... 15/07/2008 09:04:20:336;INFO;FIX recv size:101 15/07/2008 09:04:20:337;INFO;FIX Waiting for data... 15/07/2008 09:04:40:335;INFO;FIX recv size:73 15/07/2008 09:04:40:336;INFO;FIX Waiting for data... 15/07/2008 09:04:49:373;INFO;FIX recv size:101 15/07/2008 09:04:49:374;INFO;FIX Waiting for data... 15/07/2008 09:05:09:373;INFO;FIX recv size:101 15/07/2008 09:05:09:373;INFO;FIX Waiting for data... [...] 15/07/2008 09:09:24:204 QFIX IN 8=FIX.4.29=004935=049=BLP56=BNPX34=1758 52=20080715-01:04:0110=032 15/07/2008 09:09:24:206;INFO;Received HeartBeat SeqNum: 1758 This corresponds to the following piece of code in ThreadedSocketConnection.cpp: bool ThreadedSocketConnection::read() { QF_STACK_PUSH(ThreadedSocketConnection::read) char* buffer = 0; std::stringstream l_log1,l_log2; try { if ( !m_queueThreadSpawned ) m_queueThreadSpawned = thread_spawn( &queueThread, this, m_queueThread ); buffer = new char[ 4096 ]; l_log1 << horodatage_log() << ";INFO;FIX Waiting for data...\n"; printf(l_log1.str().c_str()); int result = recv( m_socket, buffer, 4095, 0 ); if ( result <= 0 ) { throw SocketRecvFailed( result ); } buffer[ result ] = '\0'; l_log2 << horodatage_log() << ";INFO;FIX recv size:" << result <<"\n"; printf(l_log2.str().c_str()); m_queue.push( std::make_pair((size_t)result, buffer) ); return true; } catch ( SocketRecvFailed& e ) { if( m_pSession ) { m_pSession->getLog()->onEvent( e.what() ); //std::cout << "ThreadedSocketConnection: session disconnection\n"; m_pSession->disconnect(); } else { //std::cout << "WARNING!! disconnection\n"; disconnect(); } delete [] buffer; m_queue.push( std::make_pair((size_t)-1, (char*)0) ); return false; } QF_STACK_POP } I would expect the m_queue.push(...) call to trigger the message processing, but for some reason, the "spawned thread" seems to wake up after a long while. Any input is appreciated. Thanks, Ilyas This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. Do not print this message unless it is necessary, consider the environment. --------------------------------------------- Ce message et toutes les pieces jointes (ci-apres le "message") sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie. N'imprimez ce message que si necessaire, pensez a l'environnement. |