Thread: [Quickfix-developers] Abnormal Termination in FileStore.cpp
Brought to you by:
orenmnero
From: BRACKLEY, A. G. <And...@rb...> - 2008-07-11 07:31:34
|
Very occassionally I get an abnormal termination in my quickfix application. I have traced this down to the FileStore::open() method in the FileStore.cpp file. The issue seems to be that sometimes it can't open the <filename>.body file which then throws a ConfigError that doesn't get handled by the thread that was spawned for the reconnections. If I run "Process Monitor" from SysInternals it shows a Sharing Violation on this file, however Process Explorer shows that no other process has this file open. There seems to be some timing issue between the file_unlink() and the file_open() commands leading to the open failing. I can work around this by changing the order the files are opened in so the last file closed is now the last file opened. There seems to be two issues here: 1) The sharing violation on the files caused by a possible timing issue with closing and opening the files 2) The fact that the ConfigError is not caught on the spawned thread. The best way I've found to replicate this is by running another process on the same port as my quickfix application so that the quickfix app constantly tries to reconnect, however this doesn't always reproduce the issue. NOTE: I'm compiling under VC9 and using an application written in .NET using quickfix_net dlls compiled under VS2008. I can provide stack traces and more information if required. Thanks *********************************************************************************** The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Authorised and regulated by the Financial Services Authority This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. Visit our websites at: www.rbs.com www.rbs.com/gbm www.rbsgc.com *********************************************************************************** ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |
From: Djalma R. d. S. F. <drs...@gm...> - 2008-07-12 19:59:51
|
Hi, I am also facing the same issues. QuickFIX is cheating itself and getting an unhandled exception because the methods in Session.cpp are expecting IOException, but in the FileStore constructor it is replacing IOException with ConfigError. try { open( false ); } catch ( IOException & e ) { throw ConfigError( e.what() ); } FileStore::open is also throwing ConfigError, but should throw IOException too. Concerning the sharing violation, I believe that the reset and refresh methods close and try to open again the files in exclusive mode and might be causing the error due to timing issues, probably an operating system issue. For reset the solution might be a simple file truncation, but for refresh I believe we really need to reopen the files. I'll also try your idea to change the order the files are opened and perhaps add a sleep call. Djalma On Fri, Jul 11, 2008 at 4:31 AM, BRACKLEY, Andrew, GBM < And...@rb...> wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Very occassionally I get an abnormal termination in my quickfix > application. I have traced this down to the FileStore::open() method in the > FileStore.cpp file. > The issue seems to be that sometimes it can't open the <filename>.body file > which then throws a ConfigError that doesn't get handled by the thread that > was spawned for the reconnections. > > If I run "Process Monitor" from SysInternals it shows a Sharing Violation > on this file, however Process Explorer shows that no other process has this > file open. There seems to be some timing issue between the file_unlink() > and the file_open() commands leading to the open failing. I can work around > this by changing the order the files are opened in so the last file closed > is now the last file opened. > > There seems to be two issues here: > > 1) The sharing violation on the files caused by a possible timing issue > with closing and opening the files > 2) The fact that the ConfigError is not caught on the spawned thread. > > The best way I've found to replicate this is by running another process on > the same port as my quickfix application so that the quickfix app constantly > tries to reconnect, however this doesn't always reproduce the issue. > > > NOTE: I'm compiling under VC9 and using an application written in .NET > using quickfix_net dlls compiled under VS2008. > > I can provide stack traces and more information if required. > > Thanks > > > *********************************************************************************** > The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered > Office: 36 St Andrew Square, Edinburgh EH2 2YB. > Authorised and regulated by the Financial Services Authority > > This e-mail message is confidential and for use by the > addressee only. If the message is received by anyone other > than the addressee, please return the message to the sender > by replying to it and then delete the message from your > computer. Internet e-mails are not necessarily secure. The > Royal Bank of Scotland plc does not accept responsibility for > changes made to this message after it was sent. > > Whilst all reasonable care has been taken to avoid the > transmission of viruses, it is the responsibility of the recipient to > ensure that the onward transmission, opening or use of this > message and any attachments will not adversely affect its > systems or data. No responsibility is accepted by The > Royal Bank of Scotland plc in this regard and the recipient should carry > out such virus and other checks as it considers appropriate. > Visit our websites at: > www.rbs.com > www.rbs.com/gbm > www.rbsgc.com > > *********************************************************************************** > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |