[omniORB] Shutting down problem
David Hyde
davidh@cavendish.co.uk
Mon, 19 Mar 2001 14:42:41 -0000
I've been thinking about this exact thing over the last couple of days for
my application. Henning and Vinoski say (I haven't got the book with me so
this is to the best of my recollection), that calling orb->shutdown(0) from
within a CORBA call can be dangerous as the client might be waiting on a
return that never happens. They say that making the call oneway can
alleviate this, but they also make the point that this behaviour is
implementation dependant.
I'm sure that Duncan will smack his forehead and say "but that's what I just
said", but for Matthew Berry's benefit I did this in a small test app and it
worked fine.
The question that I ask, though, is slightly different. What happens to
CORBA requests that are being dispatched in another object in the same
process? Because the call that results in orb->shutdown() comes in on its
own thread then I assume that calls onto other objects might be terminated
mid op, which could result in unpredictable behaviour. I can think of some
ways to protect against this - synchronisation objects around every single
call or using a work_pending() / perform_work() loop with a flag to break
out of this when the call to stop is called.
Both are more messy and I found that using the loop caused that process to
consume loads of system resources (on NT). I'd appreciate people's comments
on these matters.
Thanks very much
David Hyde
-----Original Message-----
From: Duncan Grisby [mailto:dgrisby@uk.research.att.com]
Sent: Monday, March 19, 2001 2:16 PM
To: Matthew Berry
Cc: omniORB
Subject: Re: [omniORB] Shutting down problem
On Thursday 15 March, Matthew Berry wrote:
> My server is has a shutdown method which allows a management utility to
> gracefully shutdown the server (and its dependency servers)
[...]
> I could also use orb->shutdown(0), but expect that MyServer_Impl::shutdown
> will not return and the management client will get a COMM FAILURE
exception.
Why do you expect that? That is precisely what orb->shutdown(0) is
for.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --