[omniORB] Exception shutting down the orb

Duncan Grisby duncan at grisby.org
Wed Mar 8 15:46:41 GMT 2006


On Tuesday 7 March, "Barlow, Simon" wrote:

> In the project code that we are developing, we send a shutdown command
> via a corba interface to shutdown a process. The servant that receives
> the shutdown command performs a poa->destroy to stop any more requests
> to servants being actioned once the user shutdown request has been
> received. This prevents us having to deactivate all the servants
> explicitly. Our shutdown processing is then passed of to a different
> thread which performs an orb->shutdown.
>  
> What we are finding is we get an unknown exception generated by the orb
> when the orb->Shutdown is invoked. This behaviour is random as most of
> the time the code works fine with no errors.

The "unknown exception" is an assertion failure, so it's not exactly
unknown.

The problem is a subtle race condition in the way POAs and ORBs are
destroyed. The thread shutting down the ORB sees the POA almost but not
quite completely destroyed, and progresses with the shutdown. Because
the POA hasn't completely gone, it triggers the assertion failure. I'll
look into fixing it, but it's awkward.

Having said that, you are using a particularly byzantine and awkward way
of shutting everything down. You should just call orb->shutdown(0)
inside your shutdown method. That destroys the POAs then shuts down the
ORB in one easy and convenient call. It will make your code much
simpler, and also avoid the race condition.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list