[omniORB] Is this transient exception handler OK?

Duncan Grisby duncan at grisby.org
Fri Mar 26 12:17:16 GMT 2004


On Thursday 18 March, Alex Tingle wrote:

> Is it safe to raise a system exception in an omniORB transient 
> exception handler?

Yes.

>   I'm maintaining a piece of code that contains this 
> transient handler:
> 
> CORBA::Boolean transient_handler(
>    void* cookie, CORBA::ULong retries, const CORBA::TRANSIENT& ex)
> {
>    if(retries > MAX_RETRIES)
>    {
>      throw CORBA::COMM_FAILURE(ex.minor(), ex.completed());
>    }
>    omni_thread::sleep(retries,0);
>    return 1;
> }
> 
> Clearly the author just wants to retry a couple of times and then give 
> up with a COMM_FAILURE. However, the system exhibits instability when 
> the transient exception is triggered. Could the throw be the cause of 
> that instability?

I don't think so. If you look at where the exception handlers are
called, in omniObjRef.cc, you'll see that in the case the exception
handler returns false, they just throw the exception. There's no
difference between that and the exception handler function itself
throwing.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list