[omniORB] activate_object_with_id races?

Mike Ladwig mike@twinpeaks.prc.com
Tue, 4 Dec 2001 12:40:58 -0500


On Tuesday 04 December 2001 11:48, Duncan Grisby wrote:
> On Tuesday 4 December, Mike Ladwig wrote:
> > I am having a problem with a persistent object factory where I am getting
> > a "activate_object_with_id() races with another thread doing activate /
> > deactivate. Waiting" message.
>
> I assume the problem is that it then freezes?  If not, the message is
> nothing to worry about.

Sorry.  Yes - it then freezes.

> > The code in question has been working for a while without problem,
> > so my question is if anyone knows of changes that might have caused
> > this and/or any solutions, it would be very helpful.
>
> The code that's printing the message was added after 3.0.4 to fix a
> nasty bug with race conditions between object activations and
> deactivations.

Is the error message not a bit untrue then?  There is no other thread 
activating and deactivating the object.

> One possible cause of the freeze is that a servant activator has been
> asked to incarnate a particular object id, and the incarnate()
> implementation calls activate_object_with_id(). The POA has already
> marked the object id as having an operation pending on it, so the
> activate call blocks. If this is the situation, just remove the call
> to activate_object_with_id() and it will work fine.

I think this is the problem;  unfortunately, this incarnate depends on my 
implementation of the original Persistent Object Service (!) and does the 
following:

- Create an empty object implementation
- Activate the object with the appropriate ID (And here I hang)
- Invoke the CosPer loader (external POS objects fill the empty object with 
stuff in a gruesome fashion)
- Deactivate the object
- Return the deactivated object so that incarnate's caller can itself 
activate it

> Cheers,
>
> Duncan.

Thanks,
mike.