[PolyORB-users] Handling signals

Frédéric Praca frederic.praca at free.fr
Tue Apr 2 22:18:50 CEST 2013


Le Sun, 31 Mar 2013 11:58:18 +0200,
Frédéric Praca <frederic.praca at free.fr> a écrit :

> Le Sat, 30 Mar 2013 12:24:46 +0000,
> Graham Stark <graham.stark at virtual-worlds.biz> a écrit :
> 
> > Hi,
> > 
> > > Hello guys,
> > > I would like to know how I can handle signals to perform sort of
> > > cleanup code on SIGINT.
> > > To be more precise, I have a kind of load balancer object which
> > > holds references to servant objects. These latter register
> > > themselves against the balancer. When the servant object get a
> > > SIGINT, I attached a handler to cleanly unregister it from the
> > > balancer. The problem is that I get this kind of message on the
> > > servant part : ^CUnregistering servant
> > > polyorb.orb_controller: no event source to monitor
> > > polyorb.orb: ORB.Run got exception:
> > > polyorb.orb: Exception name: PROGRAM_ERROR
> > > Message: dead lock detected
> > > 
> > > And then I have to kill my servant and the balancer doesn't know
> > > that the servant is gone.
> > > 
> > > Is there a specific way to do this kind of thing ?
> > > 
> > 
> > There's an example of what I think you're after here:
> > 
> > http://www.pegasoft.ca/resources/boblap/14.html
> > 
> > (section 14.3). 
> > 
> > I use something based on this to shut down connection pools in an
> > AWS application, and it works quite well.
> Well, that's exactly the page I looked at to implement signal handling
> but it doesn't seem to work with PolyORB as the exception message
> above mentions. For a unknwon reason, it semms that the ORB is shut
> down before I unregister my servant.

Well, I thought that creating a specific POA with a etherealize
procedure that unregister every servant could do the trick.
Do you think it's a good way to implement some cleanup code when
signals occur ?

Regards
Fred


More information about the PolyORB-users mailing list