[omniORB] Possible deadlock / hang in wait_for_detached_objects()

Harri Pasanen harri.pasanen at trema.com
Fri Jan 23 12:48:40 GMT 2004


Hi,

I run into situation where an application sometimes hung at exit, and 
traced it to the following call sequence:

omniOrbPOA::deactivate_object(const PortableServer::ObjectId& oid)
  -> calls  detached_object();
omniOrbPOA::lastInvocationHasCompleted(omniLocalIdentity* id)
  -> calls  servant->_remove_ref();
  -> calls met_detached_object();

The servant->_remove_ref(); can throw an exception, in my case it was 
CORBA::OBJECT_NOT_EXIST, and as a result met_detached_object() was 
never called, and pd_nDetachedObjecs was not decremented.

The app would then hang until kingdom come in:

void
omniObjAdapter::wait_for_detached_objects()
{
 ...
  while( pd_nDetachedObjects )  sd_detachedObjectSignal.wait();
  ...
}

In my case I could catch the exception in my servants _remove_ref, but 
as this is a recurring pattern in our code, it would make life easier 
if the OmniORB code would catch the possible exception.  I would also 
think it to be conceptually the correct thing to do, as the uncaught 
exception corrupts OmniORB's internal state.

Duncan, what is your opinion?

Regards,

Harri





More information about the omniORB-list mailing list