[omniORB] Please clarify behaviour of omniOrbPOA::deactivate_object (poa.cc - 1261)

Duncan Grisby duncan at grisby.org
Thu Jan 6 12:23:47 GMT 2011


On Tue, 2011-01-04 at 11:01 +0100, Martin B. wrote:

> I am slightly confused by the behaviour vs. the comment provided with 
> the deactivate_object() function of omniORB.
> The comment in poa.cc looks like this:
> 
> - - - - omniORB 4.1.2 / poa.cc, line 1260 - - - -
> void
> omniOrbPOA::deactivate_object(const PortableServer::ObjectId& oid)
> {
>    // Once an object is targeted for deactivation, things happen in
>    // this order:
>    //
>    //  o wait for requests to complete
>    //     -- note that new requests can arrive in the mean time, so the
>    //        deactivation may never actually complete!  This is
>    //        necessary to prevent deadlocks in objects which do
>    //        re-entrant calls to themselves.
>    //  o remove from active object map
>    //  o etherealise
>    //
>    // It is not possible to reactivate the same object until the
>    // etherealisation stage has happened. Attempts to do so are blocked
>    // until it is safe to continue.
> - - - -
> 
> The "note" confuses me, because from what I can see in the code, 
> deactivate_object() will always and unconditionally call
>    ...
>    entry->setDeactivating();
>    entry->removeFromOAObjList();
>    ...

The comment is correct. Those calls to setDeactivating() and
removeFromOAObjList() do not prevent further requests coming in to the
object. They are merely the first stage of deactivation. It is not until
setEtheralising() is called in lastInvocationHasCompleted() that new
incoming requests are denied.

> and then handle the waiting for outstanding requests separately.
> 
> This is also what I observe in my tests, namely that after I have called 
> deactivate_object(), all new requests via any already existing object 
> references will throw CORBA::OBJ_ADAPTER ( OBJ_ADAPTER_POAUnknownAdapter ).

That exception will only be thrown if the object adapter itself is
destroyed, not if an object is deactivated. Once an object is completely
deactivated, calls will throw CORBA::OBJECT_NOT_EXIST, not OBJ_ADAPTER.

Cheers,

Duncan.

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





More information about the omniORB-list mailing list