Re: [Quickfix-developers] Deadlock while stopping SocketInitiator and SocketAcceptor
Brought to you by:
orenmnero
From: Dominik B. <dom...@gm...> - 2010-12-16 08:45:08
|
Hi Fabio, I have the exact same issue here. I have searched the internet for solutions but I haven't anything except the old posts from 2005. The only way I've reliably been able to get around this behavior was to set the initiator to null and call GC.Collect. This obviously isn't a nice solution at all so I would be glad for any other solution. Dominik On Thu, Dec 16, 2010 at 9:04 AM, Fabio Renggli <FRe...@1e...> wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Hi together > > > > We use QuickFIX in a .NET windows service to reroute messages from > different systems to a single end point, similar to a NAT service. > > We have recently updated from QuickFIX 1.12.4 to the latest release because > we where facing major memory issues. > > The problem we get with the new release is, that we get a deadlock while > stopping the initiator (SocketInitiator.stop()) and even get a deadlock > while forced stopping the acceptor when the windows service ist stopped via > the console. Right now we are using a single acceptor with two SessionIDs to > receive messages from two different systems. > > We found some mail list messages from 2005 addressing this issue, and it > seemed solved when forcing the stop, but we're running into the deadlock > anyway. > > Is there anything we can do to have the service stop savely and controlled > or would you recommend to abort the threads without trying to stop them? > > Here is some of the code (implementing the catch block is not necessary, > because it never gets there) in our windows service: > > protected override void OnStop() > > { > > try > > { > > initiator.stop(true); > > initiator.Dispose(); > > initiator = null; > > acceptor.stop(true); > > acceptor.Dispose(); > > acceptor = null; > > } > > catch { } > > } > > protected override void OnStart(string[] args) > > { > > //... create App, Settings, Factories > > initiator = new SocketInitiator(iApp, iStoreFactory, iSettings, > iLogFactory, iMessageFactory); > > new Thread(initiator.start).Start(); > > acceptor = new SocketAcceptor(aApp, aStoreFactory, aSetting, aLogFactory, > aMessageFactory); > > new Thread(acceptor.start).Start(); > > } > > > > Mit freundlichen Grüssen / Kind regards > *1eEurope (Switzerland) AG* > > Fabio Renggli > > Technology Consultant > > --------------------------------- > > > 1eEurope (Switzerland) AG > Seestrasse 97 > CH-8800 Thalwil > > Tel. Direkt: +41 (0) 44 722 86 05 > > Tel. Zentrale: +41 (0) 44 722 75 55 > > *frenggli*@1eeurope.ch <MB...@1e...> > > www.1eEurope.ch <http://www.1eeurope.ch/> > > > > This message may contain confidential information and is intended only for > the individual named. If you are not the named addressee, please notify the > sender immediately and do not disclose, copy or distribute the content to > any other person. > > E-Mail transmission cannot be guaranteed to be secure or error-free as > information can be intercepted, lost, destroyed, arrive late, incomplete or > contain any viruses. Any contractual representations contained herein on > behalf of this company must not be taken as final, and are entirely subject > to contracts signed formally by an authorised representative of this > company. > > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |