Re: [Quickfix-developers] Cannot reconnect after ungraceful disconnect
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2005-10-27 23:17:31
|
The thread should become unregistered in the destructor of the ThreadedSocketConnection class. This was implemented mostly for the sake of the acceptance tests. It takes some amount of time to close a connection and free up the session. The acceptance test runner brings up connections for each test. If the connection from the previous test doesn't close down fast enough, then the test will fail because it is unable to aquire the session. This just allows the connector to retry registering the session for some amount of time before declaring it a failure. Since this is a multi threaded implementation, we cannot rely on all the events to be processed serially like the single threaded implementation. If you are not able to aquire the session during an abnormal disconnect, it would suggest that the old connector is not being deleted (and thus no destructor call and no unregistering the session ). The deletion of the connection class occurs in ThreadedSocketAcceptor::socketThread. If for some reason pConnection->read() is never returning false, then perhaps the connection is not getting deleted. --oren ----- Original Message ----- From: "John Debay" <joh...@ch...> To: <qui...@li...> Cc: "Nicholas Murdock" <nic...@ch...> Sent: Thursday, October 27, 2005 10:32 AM Subject: [Quickfix-developers] Cannot reconnect after ungraceful disconnect > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Hi, > > We are having issues re-establishing QuickFIX sessions after our initiator > disconnects ungracefully. We have traced through the code, and our problem > seems to be this loop inside ThreadedSocketConnection::setSession(): > > // see if the session frees up within 5 seconds > for ( int i = 1; i <= 5; ++i ) > { > m_pSession = Session::registerSession( sessionID ); > if ( m_pSession ) break; > process_sleep( 1 ); > } > > Question 1: What is this loop doing? Who is going to free the session > within > 5 seconds? > > As I step through Session::resgisterSession(), the problem seems to be > here: > > if ( isSessionRegistered( sessionID ) ) return 0; > > isSessionRegistered() always returns true, so the session is never > re-established. > > Can anyone help me understand what is going on here? When should > isSessionRegistered() return false? After a session has been physically > disconnected? At some other time? > > Thanks in advance for any help or advice. > > John > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |